I have a small problem and I hope someone can help me with that. Basically, I have a script that downloads thumbnails from Youtube, it works normally, but now I want it to be more advanced and have the option to give the url of a playlist (system to choose already made) and get the html page of the playlist, then find all the lines that contain /watch?v= (the url of the video) and then take out everything except for the video id (the series of characters after v=).
Now I have the downloading system working, I just cannot find a way to make get the lines with /watch?v=.
Here's my code with the downloading of webpage and finding line parts
read -p "Enter the url of the playlist : " link #Ask for url
content=$(curl $link --silent) #Downloads the webpage
contentxt="$basedir/playlist_page.txt" #Creates a file to store the webpage
echo $content > "$contentxt" #Saves the webpage into the file
url=$(grep -F "/watch?v=" $contentxt) #Find a line with the /watch?v=
echo $url #Displays that line containing the url to be used later
Thank you!