]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[history] add support for episode pages(fixes #8240)
authorremitamine <remitamine@gmail.com>
Fri, 15 Jan 2016 14:16:57 +0000 (15:16 +0100)
committerremitamine <remitamine@gmail.com>
Fri, 15 Jan 2016 14:16:57 +0000 (15:16 +0100)
youtube_dl/extractor/history.py

index f86164afe791dbfddad8240dfcfa8a0f441c7e11..9ec2e92cf82ed41cbdf7dee8835cd433c2d05eed 100644 (file)
@@ -9,13 +9,29 @@ class HistoryIE(InfoExtractor):
 
     _TESTS = [{
         'url': 'http://www.history.com/topics/valentines-day/history-of-valentines-day/videos/bet-you-didnt-know-valentines-day?m=528e394da93ae&s=undefined&f=1&free=false',
-        'md5': '6fe632d033c92aa10b8d4a9be047a7c5',
         'info_dict': {
-            'id': 'bLx5Dv5Aka1G',
+            'id': 'g12m5Gyt3fdR',
             'ext': 'mp4',
             'title': "Bet You Didn't Know: Valentine's Day",
             'description': 'md5:7b57ea4829b391995b405fa60bd7b5f7',
         },
+        'params': {
+            # m3u8 download
+            'skip_download': True,
+        },
+        'add_ie': ['ThePlatform'],
+    }, {
+        'url': 'http://www.history.com/shows/mountain-men/season-1/episode-1',
+        'info_dict': {
+            'id': 'eg47EERs_JsZ',
+            'ext': 'mp4',
+            'title': "Winter Is Coming",
+            'description': 'md5:a40e370925074260b1c8a633c632c63a',
+        },
+        'params': {
+            # m3u8 download
+            'skip_download': True,
+        },
         'add_ie': ['ThePlatform'],
     }]
 
@@ -24,8 +40,10 @@ class HistoryIE(InfoExtractor):
 
         webpage = self._download_webpage(url, video_id)
 
-        video_url = self._search_regex(
+        video_url_re = [
             r'data-href="[^"]*/%s"[^>]+data-release-url="([^"]+)"' % video_id,
-            webpage, 'video url')
+            r"media_url\s*=\s*'([^']+)'"
+        ]
+        video_url = self._search_regex(video_url_re, webpage, 'video url')
 
         return self.url_result(smuggle_url(video_url, {'sig': {'key': 'crazyjava', 'secret': 's3cr3t'}}))