[ooyala] check manifest ext with determine_ext and update tests for related extractors
authorremitamine <remitamine@gmail.com>
Tue, 24 May 2016 10:24:29 +0000 (11:24 +0100)
committerremitamine <remitamine@gmail.com>
Tue, 24 May 2016 10:24:29 +0000 (11:24 +0100)
youtube_dl/extractor/byutv.py
youtube_dl/extractor/espn.py
youtube_dl/extractor/formula1.py
youtube_dl/extractor/groupon.py
youtube_dl/extractor/howcast.py
youtube_dl/extractor/ooyala.py
youtube_dl/extractor/teachingchannel.py
youtube_dl/extractor/veoh.py
youtube_dl/extractor/vice.py
youtube_dl/extractor/voxmedia.py

index dda98059e9041c651de5a211fccb2c106b11bb75..54eb57b46ba30dac380fb400543fceb8be06279b 100644 (file)
@@ -11,6 +11,7 @@ class BYUtvIE(InfoExtractor):
     _VALID_URL = r'^https?://(?:www\.)?byutv.org/watch/[0-9a-f-]+/(?P<video_id>[^/?#]+)'
     _TEST = {
         'url': 'http://www.byutv.org/watch/6587b9a3-89d2-42a6-a7f7-fd2f81840a7d/studio-c-season-5-episode-5',
+        'md5': '05850eb8c749e2ee05ad5a1c34668493',
         'info_dict': {
             'id': 'studio-c-season-5-episode-5',
             'ext': 'mp4',
@@ -19,9 +20,7 @@ class BYUtvIE(InfoExtractor):
             'thumbnail': 're:^https?://.*\.jpg$',
             'duration': 1486.486,
         },
-        'params': {
-            'skip_download': True,
-        }
+        'add_ie': ['Ooyala'],
     }
 
     def _real_extract(self, url):
index db4b263bcbf40a9cb133d2a9729e4fe07292bae3..e3575aed1df2b48e43fd862866c4aee0ff0b4a30 100644 (file)
@@ -8,28 +8,24 @@ class ESPNIE(InfoExtractor):
     _VALID_URL = r'https?://espn\.go\.com/(?:[^/]+/)*(?P<id>[^/]+)'
     _TESTS = [{
         'url': 'http://espn.go.com/video/clip?id=10365079',
+        'md5': '60e5d097a523e767d06479335d1bdc58',
         'info_dict': {
             'id': 'FkYWtmazr6Ed8xmvILvKLWjd4QvYZpzG',
             'ext': 'mp4',
             'title': '30 for 30 Shorts: Judging Jewell',
             'description': None,
         },
-        'params': {
-            # m3u8 download
-            'skip_download': True,
-        },
+        'add_ie': ['OoyalaExternal'],
     }, {
         # intl video, from http://www.espnfc.us/video/mls-highlights/150/video/2743663/must-see-moments-best-of-the-mls-season
         'url': 'http://espn.go.com/video/clip?id=2743663',
+        'md5': 'f4ac89b59afc7e2d7dbb049523df6768',
         'info_dict': {
             'id': '50NDFkeTqRHB0nXBOK-RGdSG5YQPuxHg',
             'ext': 'mp4',
             'title': 'Must-See Moments: Best of the MLS season',
         },
-        'params': {
-            # m3u8 download
-            'skip_download': True,
-        },
+        'add_ie': ['OoyalaExternal'],
     }, {
         'url': 'https://espn.go.com/video/iframe/twitter/?cms=espn&id=10365079',
         'only_matching': True,
index 726393fccf7dbbde385887d3aba96a58d175a3a6..322c41e5afcb20935f4f7841ccb03303d5476f65 100644 (file)
@@ -13,7 +13,8 @@ class Formula1IE(InfoExtractor):
             'id': 'JvYXJpMzE6pArfHWm5ARp5AiUmD-gibV',
             'ext': 'flv',
             'title': 'Race highlights - Spain 2016',
-        }
+        },
+        'add_ie': ['Ooyala'],
     }
 
     def _real_extract(self, url):
index 1dd0a81cca13a8a44e5e25e2245cce9563399b70..7bbb669c7ab1b92ea6e42445026ea5594a63cd28 100644 (file)
@@ -14,6 +14,7 @@ class GrouponIE(InfoExtractor):
             'description': 'Studio kept at 105 degrees and 40% humidity with anti-microbial and anti-slip Flotex flooring; certified instructors',
         },
         'playlist': [{
+            'md5': '42428ce8a00585f9bc36e49226eae7a1',
             'info_dict': {
                 'id': 'fk6OhWpXgIQ',
                 'ext': 'mp4',
@@ -24,10 +25,8 @@ class GrouponIE(InfoExtractor):
                 'uploader_id': 'groupon',
                 'uploader': 'Groupon',
             },
-        }],
-        'params': {
-            'skip_download': True,
-        }
+            'add_ie': ['Youtube'],
+        }]
     }
 
     _PROVIDERS = {
index e8f51e545bfd2b89a251e1a4fbbeefe80aa371f9..92caeb8f941a32bbc4c9fc67713e724204c01232 100644 (file)
@@ -8,7 +8,7 @@ class HowcastIE(InfoExtractor):
     _VALID_URL = r'https?://(?:www\.)?howcast\.com/videos/(?P<id>\d+)'
     _TEST = {
         'url': 'http://www.howcast.com/videos/390161-How-to-Tie-a-Square-Knot-Properly',
-        'md5': '8b743df908c42f60cf6496586c7f12c3',
+        'md5': '7d45932269a288149483144f01b99789',
         'info_dict': {
             'id': '390161',
             'ext': 'mp4',
@@ -18,10 +18,7 @@ class HowcastIE(InfoExtractor):
             'upload_date': '20100609',
             'duration': 56.823,
         },
-        'params': {
-            # m3u8 download
-            'skip_download': True,
-        },
+        'add_ie': ['Ooyala'],
     }
 
     def _real_extract(self, url):
index 09bc291f028964a2ac36818e5ef25725ddf6fad9..2038a6ba5001283e786905a23c429d2418762515 100644 (file)
@@ -8,6 +8,7 @@ from ..utils import (
     float_or_none,
     ExtractorError,
     unsmuggle_url,
+    determine_ext,
 )
 from ..compat import compat_urllib_parse_urlencode
 
@@ -37,26 +38,27 @@ class OoyalaBaseIE(InfoExtractor):
         formats = []
         if cur_auth_data['authorized']:
             for stream in cur_auth_data['streams']:
-                url = base64.b64decode(
+                s_url = base64.b64decode(
                     stream['url']['data'].encode('ascii')).decode('utf-8')
-                if url in urls:
+                if s_url in urls:
                     continue
-                urls.append(url)
+                urls.append(s_url)
+                ext = determine_ext(s_url, None)
                 delivery_type = stream['delivery_type']
-                if delivery_type == 'hls' or '.m3u8' in url:
+                if delivery_type == 'hls' or ext == 'm3u8':
                     formats.extend(self._extract_m3u8_formats(
-                        url, embed_code, 'mp4', 'm3u8_native',
+                        s_url, embed_code, 'mp4', 'm3u8_native',
                         m3u8_id='hls', fatal=False))
-                elif delivery_type == 'hds' or '.f4m' in url:
+                elif delivery_type == 'hds' or ext == 'f4m':
                     formats.extend(self._extract_f4m_formats(
-                        url + '?hdcore=3.7.0', embed_code, f4m_id='hds', fatal=False))
-                elif '.smil' in url:
+                        s_url + '?hdcore=3.7.0', embed_code, f4m_id='hds', fatal=False))
+                elif ext == 'smil':
                     formats.extend(self._extract_smil_formats(
-                        url, embed_code, fatal=False))
+                        s_url, embed_code, fatal=False))
                 else:
                     formats.append({
-                        'url': url,
-                        'ext': stream.get('delivery_type'),
+                        'url': s_url,
+                        'ext': ext or stream.get('delivery_type'),
                         'vcodec': stream.get('video_codec'),
                         'format_id': delivery_type,
                         'width': int_or_none(stream.get('width')),
index e0477382ceabea0769bd0575ceb1f350ce8c0911..e279280e9a68bf8f030c1b451fa751ee1ec0f29e 100644 (file)
@@ -11,6 +11,7 @@ class TeachingChannelIE(InfoExtractor):
 
     _TEST = {
         'url': 'https://www.teachingchannel.org/videos/teacher-teaming-evolution',
+        'md5': '3d6361864d7cac20b57c8784da17166f',
         'info_dict': {
             'id': 'F3bnlzbToeI6pLEfRyrlfooIILUjz4nM',
             'ext': 'mp4',
@@ -18,10 +19,7 @@ class TeachingChannelIE(InfoExtractor):
             'description': 'md5:2a9033db8da81f2edffa4c99888140b3',
             'duration': 422.255,
         },
-        'params': {
-            # m3u8 download
-            'skip_download': True,
-        },
+        'add_ie': ['Ooyala'],
     }
 
     def _real_extract(self, url):
index 23ce0a0d1929febac87f789374d8411d7b7ddd00..0f5d6873808ed2dce5cde2e6239b6973cf809367 100644 (file)
@@ -37,6 +37,7 @@ class VeohIE(InfoExtractor):
                 'uploader': 'afp-news',
                 'duration': 123,
             },
+            'skip': 'This video has been deleted.',
         },
         {
             'url': 'http://www.veoh.com/watch/v69525809F6Nc4frX',
index 95daf4dfdf2155dbbab26f2896cf3c42e0f33e2f..e2b2ce0981cc8767ade2f5ef4c8bc52759b86af3 100644 (file)
@@ -11,12 +11,14 @@ class ViceIE(InfoExtractor):
 
     _TESTS = [{
         'url': 'http://www.vice.com/video/cowboy-capitalists-part-1',
+        'md5': 'e9d77741f9e42ba583e683cd170660f7',
         'info_dict': {
             'id': '43cW1mYzpia9IlestBjVpd23Yu3afAfp',
             'ext': 'flv',
             'title': 'VICE_COWBOYCAPITALISTS_PART01_v1_VICE_WM_1080p.mov',
             'duration': 725.983,
         },
+        'add_ie': ['Ooyala'],
     }, {
         'url': 'http://www.vice.com/video/how-to-hack-a-car',
         'md5': '6fb2989a3fed069fb8eab3401fc2d3c9',
@@ -29,6 +31,7 @@ class ViceIE(InfoExtractor):
             'uploader': 'Motherboard',
             'upload_date': '20140529',
         },
+        'add_ie': ['Youtube'],
     }, {
         'url': 'https://news.vice.com/video/experimenting-on-animals-inside-the-monkey-lab',
         'only_matching': True,
index 9d73600aa8b752985f3b3b2c4375af343e1c3d6b..b1b32ad44ecfd796e46219a87ea71caa3587face 100644 (file)
@@ -15,7 +15,8 @@ class VoxMediaIE(InfoExtractor):
             'ext': 'mp4',
             'title': 'Google\'s new material design direction',
             'description': 'md5:2f44f74c4d14a1f800ea73e1c6832ad2',
-        }
+        },
+        'add_ie': ['Ooyala'],
     }, {
         # data-ooyala-id
         'url': 'http://www.theverge.com/2014/10/21/7025853/google-nexus-6-hands-on-photos-video-android-phablet',
@@ -25,7 +26,8 @@ class VoxMediaIE(InfoExtractor):
             'ext': 'mp4',
             'title': 'The Nexus 6: hands-on with Google\'s phablet',
             'description': 'md5:87a51fe95ff8cea8b5bdb9ac7ae6a6af',
-        }
+        },
+        'add_ie': ['Ooyala'],
     }, {
         # volume embed
         'url': 'http://www.vox.com/2016/3/31/11336640/mississippi-lgbt-religious-freedom-bill',
@@ -35,7 +37,8 @@ class VoxMediaIE(InfoExtractor):
             'ext': 'mp4',
             'title': 'The new frontier of LGBTQ civil rights, explained',
             'description': 'md5:0dc58e94a465cbe91d02950f770eb93f',
-        }
+        },
+        'add_ie': ['Ooyala'],
     }, {
         # youtube embed
         'url': 'http://www.vox.com/2016/3/24/11291692/robot-dance',
@@ -48,7 +51,8 @@ class VoxMediaIE(InfoExtractor):
             'upload_date': '20160324',
             'uploader_id': 'voxdotcom',
             'uploader': 'Vox',
-        }
+        },
+        'add_ie': ['Youtube'],
     }, {
         # SBN.VideoLinkset.entryGroup multiple ooyala embeds
         'url': 'http://www.sbnation.com/college-football-recruiting/2015/2/3/7970291/national-signing-day-rationalizations-itll-be-ok-itll-be-ok',