ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.56k stars 10.05k forks source link

Add support for http://www.streamago.tv/ #2275

Open marste opened 10 years ago

marste commented 10 years ago

Thank you very much!

prutz1311 commented 10 years ago

Please post the verbose output which you get when running youtube-dl with -v option, so we can see if the site is exactly not supported and what is happenning.

marste commented 10 years ago

youtube-dl -v http://www.streamago.tv/general/29664/motociclismo/web-2013-11-19-11-40-05.html [debug] System config: [] [debug] User config: [] [debug] Command-line args: ['-v', 'http://www.streamago.tv/general/29664/motocic lismo/web-2013-11-19-11-40-05.html'] [debug] Encodings: locale 'cp1252', fs 'mbcs', out 'cp850', pref: 'cp1252' [debug] youtube-dl version 2014.01.30.1 [debug] Python version 2.7.5 - Windows-XP-5.1.2600-SP3 [debug] Proxy map: {} [generic] web-2013-11-19-11-40-05: Requesting header WARNING: Falling back on generic information extractor. [generic] web-2013-11-19-11-40-05: Downloading webpage [generic] web-2013-11-19-11-40-05: Extracting information ERROR: Unsupported URL: http://www.streamago.tv/general/29664/motociclismo/web-2 013-11-19-11-40-05.html;

please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update. Traceback (most recent call last): File "youtube_dl\YoutubeDL.pyo", line 493, in extract_info File "youtube_dl\extractor\common.pyo", line 158, in extract File "youtube_dl\extractor\generic.pyo", line 382, in _real_extract ExtractorError: Unsupported URL: http://www.streamago.tv/general/29664/motocicli smo/web-2013-11-19-11-40-05.html; please report this issue on https://yt-dl.org/ bug . Be sure to call youtube-dl with the --verbose flag and include its complet e output. Make sure you are using the latest version; type youtube-dl -U to up date.

yasoob commented 10 years ago

@jaimeMF I have written this code so far:

import requests
import re
import sys

#url = sys.argv[0]
url = "http://www.streamago.tv/general/29664/motociclismo/web-2013-11-19-11-40-05.html"
html = requests.get(url)
xml_link = 'http://www.streamago.tv/' + re.search("{xml:'(.+?)'}",html.text).group(1)
xml_page = requests.get(xml_link)
mp4_link = re.search('<path_hls>(<\!\[CDATA\[(.+?)\]\]>)</path_hls>',xml_page.text).group(2)
print mp4_link

Now I just need a way to parse m3u8 file. If I open the returned link in my browser QuickTime plugin detects it and runs the video whereas if I run:

wget http://cdnselector.streamago.tv/vod/stg02/29/29664/23952/web1384857384099.mp4/playlist.m3u8?idmovie=47543

(the link used above is the mp4_link returned by my script) I just get a file containing this:

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1477653,CODECS="avc1.66.30, mp4a.40.2",RESOLUTION=426x240
chunklist.m3u8?wowzasessionid=298224071&pwd=&idmovie=47543

I have no experience with parsing m3u8 files so any further help is appreciated.