0

I'm using a yt-dlp but sometimes the video couldn't download by the url of the video page, it needs the m3u8 url, I know that I can find the m3u8 in the browser inspect but I want to get it by using a Python code or library, to get more than m3u8 urls at once.

Please help me to find a solution

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Oct 09 '22 at 09:23
  • @MohammedAlsahli Please post a reproducible Python code sample that shows an example to the case you are describing. In case you want to comment me back, start the comment with `@Rotem`. – Rotem Oct 09 '22 at 20:49
  • @Rotem I didn't write any code about the m3u8 yet, but I want to make a part of my code to sniff the m3u8 link just like the extension called "Video m3u8 Sniffer - Find HLS Streaming URLs" and then save it to print it, but I don't know how to do it, I searched about the question but all posts talked about "how to save m3u8 video" not about "how to extract m3u8 link", I know I can go to the network in the inspector but I want to do it by a code. – MohammedAlsahli Oct 10 '22 at 15:38
  • I found [this post](https://stackoverflow.com/questions/61713238/how-to-find-m3u8-file-from-url-and-download-it), that involves the same issue. Inspecting a web page is far from my expertise, so I can't help you. Using [Selenium](https://pypi.org/project/selenium/) may be a good starting point. When asking a question in Stack Overflow it is highly recommended to show something you have tried. It is also recommended to be more specific. – Rotem Oct 10 '22 at 20:22
  • @Rotem thanks for trying, I wrote a code to extract the m3u8 link from HTML tags, `import requests from bs4 import BeautifulSoup from itertools import zip_longest # result = requests.get(str(input('page url: '))) # user url result = requests.get('https://www.faselhd.club/series/%d9%85%d8%b3%d9%84%d8%b3%d9%84-friends-%d8%a7%d9%84%d9%85%d9%88%d8%b3%d9%85-%d8%a7%d9%84%d8%b9%d8%a7%d8%b4%d8%b1') content = result.content soup = BeautifulSoup(content, 'lxml') movie_quality = soup.find_all('div', {'class':'quality_change'}) print(movie_quality)` but the output is empty. – MohammedAlsahli Oct 11 '22 at 13:53

0 Answers0