ソースを参照

[rentv] Move rentv test from generic extractor and add only matching tests

Sergey M․ 8 年 前
コミット
773017c648
2 ファイル変更24 行追加18 行削除
  1. 0 14
      youtube_dl/extractor/generic.py
  2. 24 4
      youtube_dl/extractor/rentv.py

+ 0 - 14
youtube_dl/extractor/generic.py

@@ -1208,20 +1208,6 @@ class GenericIE(InfoExtractor):
                 'duration': 51690,
                 'duration': 51690,
             },
             },
         },
         },
-        # JWPlayer with M3U8
-        {
-            'url': 'http://ren.tv/novosti/2015-09-25/sluchaynyy-prohozhiy-poymal-avtougonshchika-v-murmanske-video',
-            'info_dict': {
-                'id': 'playlist',
-                'ext': 'mp4',
-                'title': 'Случайный прохожий поймал автоугонщика в Мурманске. ВИДЕО | РЕН ТВ',
-                'uploader': 'ren.tv',
-            },
-            'params': {
-                # m3u8 downloads
-                'skip_download': True,
-            }
-        },
         # Brightcove embed, with no valid 'renditions' but valid 'IOSRenditions'
         # Brightcove embed, with no valid 'renditions' but valid 'IOSRenditions'
         # This video can't be played in browsers if Flash disabled and UA set to iPhone, which is actually a false alarm
         # This video can't be played in browsers if Flash disabled and UA set to iPhone, which is actually a false alarm
         {
         {

+ 24 - 4
youtube_dl/extractor/rentv.py

@@ -8,7 +8,7 @@ from ..compat import compat_str
 
 
 class RENTVIE(JWPlatformBaseIE):
 class RENTVIE(JWPlatformBaseIE):
     _VALID_URL = r'(?:rentv:|https?://(?:www\.)?ren\.tv/(?:player|video/epizod)/)(?P<id>\d+)'
     _VALID_URL = r'(?:rentv:|https?://(?:www\.)?ren\.tv/(?:player|video/epizod)/)(?P<id>\d+)'
-    _TEST = {
+    _TESTS = [{
         'url': 'http://ren.tv/video/epizod/118577',
         'url': 'http://ren.tv/video/epizod/118577',
         'md5': 'd91851bf9af73c0ad9b2cdf76c127fbb',
         'md5': 'd91851bf9af73c0ad9b2cdf76c127fbb',
         'info_dict': {
         'info_dict': {
@@ -16,7 +16,13 @@ class RENTVIE(JWPlatformBaseIE):
             'ext': 'mp4',
             'ext': 'mp4',
             'title': 'Документальный спецпроект: "Промывка мозгов. Технологии XXI века"'
             'title': 'Документальный спецпроект: "Промывка мозгов. Технологии XXI века"'
         }
         }
-    }
+    }, {
+        'url': 'http://ren.tv/player/118577',
+        'only_matching': True,
+    }, {
+        'url': 'rentv:118577',
+        'only_matching': True,
+    }]
 
 
     def _real_extract(self, url):
     def _real_extract(self, url):
         video_id = self._match_id(url)
         video_id = self._match_id(url)
@@ -28,7 +34,7 @@ class RENTVIE(JWPlatformBaseIE):
 
 
 class RENTVArticleIE(InfoExtractor):
 class RENTVArticleIE(InfoExtractor):
     _VALID_URL = r'https?://(?:www\.)?ren\.tv/novosti/\d{4}-\d{2}-\d{2}/(?P<id>[^/?#]+)'
     _VALID_URL = r'https?://(?:www\.)?ren\.tv/novosti/\d{4}-\d{2}-\d{2}/(?P<id>[^/?#]+)'
-    _TEST = {
+    _TESTS = [{
         'url': 'http://ren.tv/novosti/2016-10-26/video-mikroavtobus-popavshiy-v-dtp-s-gruzovikami-v-podmoskove-prevratilsya-v',
         'url': 'http://ren.tv/novosti/2016-10-26/video-mikroavtobus-popavshiy-v-dtp-s-gruzovikami-v-podmoskove-prevratilsya-v',
         'md5': 'ebd63c4680b167693745ab91343df1d6',
         'md5': 'ebd63c4680b167693745ab91343df1d6',
         'info_dict': {
         'info_dict': {
@@ -37,7 +43,21 @@ class RENTVArticleIE(InfoExtractor):
             'title': 'Видео: микроавтобус, попавший в ДТП с грузовиками в Подмосковье, превратился в груду металла',
             'title': 'Видео: микроавтобус, попавший в ДТП с грузовиками в Подмосковье, превратился в груду металла',
             'description': 'Жертвами столкновения двух фур и микроавтобуса, по последним данным, стали семь человек.',
             'description': 'Жертвами столкновения двух фур и микроавтобуса, по последним данным, стали семь человек.',
         }
         }
-    }
+    }, {
+        # TODO: invalid m3u8
+        'url': 'http://ren.tv/novosti/2015-09-25/sluchaynyy-prohozhiy-poymal-avtougonshchika-v-murmanske-video',
+        'info_dict': {
+            'id': 'playlist',
+            'ext': 'mp4',
+            'title': 'Случайный прохожий поймал автоугонщика в Мурманске. ВИДЕО | РЕН ТВ',
+            'uploader': 'ren.tv',
+        },
+        'params': {
+            # m3u8 downloads
+            'skip_download': True,
+        },
+        'skip': True,
+    }]
 
 
     def _real_extract(self, url):
     def _real_extract(self, url):
         display_id = self._match_id(url)
         display_id = self._match_id(url)