summary refs log tree commit diff
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2015-10-09 23:36:31 +0100
committerSergey M․ <dstftw@gmail.com>2015-10-11 19:24:19 +0600
commit03e3b4e1198631b30914e8669b01bf1825a4385c (patch)
tree745f047bdab60614205f375bbcc2588d645ddc37
parentd8348c351d5ed4bb820b190e42b9a02e2dfc27a7 (diff)
downloadyoutube-dl-03e3b4e1198631b30914e8669b01bf1825a4385c.tar.gz
youtube-dl-03e3b4e1198631b30914e8669b01bf1825a4385c.tar.xz
youtube-dl-03e3b4e1198631b30914e8669b01bf1825a4385c.zip
[expotv] parse m3u8 manifest
-rw-r--r--youtube_dl/extractor/expotv.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/youtube_dl/extractor/expotv.py b/youtube_dl/extractor/expotv.py
index a38b773e8..23a38c7c1 100644
--- a/youtube_dl/extractor/expotv.py
+++ b/youtube_dl/extractor/expotv.py
@@ -33,20 +33,24 @@ class ExpoTVIE(InfoExtractor):
         webpage = self._download_webpage(url, video_id)
         player_key = self._search_regex(
             r'<param name="playerKey" value="([^"]+)"', webpage, 'player key')
-        config_url = 'http://client.expotv.com/video/config/%s/%s' % (
-            video_id, player_key)
         config = self._download_json(
-            config_url, video_id,
-            note='Downloading video configuration')
+                'http://client.expotv.com/video/config/%s/%s' % (video_id, player_key),
+                video_id,
+                note='Downloading video configuration')
 
-        formats = [{
-            'url': fcfg['file'],
-            'height': int_or_none(fcfg.get('height')),
-            'format_note': fcfg.get('label'),
-            'ext': self._search_regex(
-                r'filename=.*\.([a-z0-9_A-Z]+)&', fcfg['file'],
-                'file extension', default=None),
-        } for fcfg in config['sources']]
+        formats = []
+        for fcfg in config['sources']:
+            if fcfg['type'] == 'm3u8':
+                formats.extend(self._extract_m3u8_formats(fcfg['file'], video_id))
+            else:
+                formats.append({
+                    'url': fcfg['file'],
+                    'height': int_or_none(fcfg.get('height')),
+                    'format_id': fcfg.get('label'),
+                    'ext': self._search_regex(
+                        r'filename=.*\.([a-z0-9_A-Z]+)&', fcfg['file'],
+                        'file extension', default=None),
+                })
         self._sort_formats(formats)
 
         title = self._og_search_title(webpage)