I am trying to get URLs on a single youtube video page. youtube-dl can do this but I just need urls, so I want to learn how to do this.
it is my code to get page source: source = requests.get("https://www.youtube.com/watch?v=zXif_9RVadI")
I am looking for 21. line of this code: source_line_21 = source.text.split("\n")[20]
all urls starting with https://r[0-9] and including googlevideo.com/videoplayback and ending with ","
I tried many of code but I always getting 0 or 1 match. But there is 15-20 matches.
re.match(r'https:\/\/.*googlevideo.com/videoplayback.*mimeType', source_line_21)
I am not good at regex, I can not get it well. Thank you for all.
Output of print(source_line_21)[:32600] I am searching at here. It is too long, so I paste to there: print(source_line_21)[:32600]