Merge pull request #8718 from remitamine/m3u8-fixup
[youtube-dl] / youtube_dl / extractor / foxnews.py
index 0cd0f9fa83a5a79c1ded752353b81b2880c838ab..1dc50318ce81feb2604cfef943ddfb90e0a7641b 100644 (file)
@@ -3,10 +3,6 @@ from __future__ import unicode_literals
 import re
 
 from .amp import AMPIE
-from ..utils import (
-    parse_iso8601,
-    int_or_none,
-)
 
 
 class FoxNewsIE(AMPIE):
@@ -22,8 +18,8 @@ class FoxNewsIE(AMPIE):
                 'title': 'Frozen in Time',
                 'description': '16-year-old girl is size of toddler',
                 'duration': 265,
-                #'timestamp': 1304411491,
-                #'upload_date': '20110503',
+                # 'timestamp': 1304411491,
+                # 'upload_date': '20110503',
                 'thumbnail': 're:^https?://.*\.jpg$',
             },
         },
@@ -36,10 +32,14 @@ class FoxNewsIE(AMPIE):
                 'title': "Rep. Luis Gutierrez on if Obama's immigration plan is legal",
                 'description': "Congressman discusses president's plan",
                 'duration': 292,
-                #'timestamp': 1417662047,
-                #'upload_date': '20141204',
+                # 'timestamp': 1417662047,
+                # 'upload_date': '20141204',
                 'thumbnail': 're:^https?://.*\.jpg$',
             },
+            'params': {
+                # m3u8 download
+                'skip_download': True,
+            },
         },
         {
             'url': 'http://video.foxnews.com/v/video-embed.html?video_id=3937480&d=video.foxnews.com',
@@ -52,10 +52,9 @@ class FoxNewsIE(AMPIE):
     ]
 
     def _real_extract(self, url):
-        mobj = re.match(self._VALID_URL, url)
-        video_id = mobj.group('id')
-        host = mobj.group('host')
+        host, video_id = re.match(self._VALID_URL, url).groups()
 
-        info = self._extract_feed_info('http://%s/v/feed/video/%s.js?template=fox' % (host, video_id))
+        info = self._extract_feed_info(
+            'http://%s/v/feed/video/%s.js?template=fox' % (host, video_id))
         info['id'] = video_id
         return info