#!/bin/sh TODAY=$(date '+%d/%m/%y') VIDEO_ID=$( curl -s https://www.youtube.com/playlist\?list\=PLtk0IJ09y34XS044BgNOsFvd8FD4mPYQY \ | sed -n '/var ytInitialData/ { s/^.*ytInitialData = //; s/;.*$//; p }' \ | jq -r ".contents.twoColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].playlistVideoListRenderer.contents[] | select(.playlistVideoRenderer.title.runs[0].text == \"Informativo matinal express [$TODAY]\") | .playlistVideoRenderer.videoId") if [ -z "$VIDEO_ID" ]; then exit 0 fi echo -e "Informativo matinal para ahorraros tiempo [$TODAY]\nhttps://www.youtube.com/watch?v=$VIDEO_ID"