]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/rds.py
[ie/matchtv] Fix extractor (#10190)
[yt-dlp.git] / yt_dlp / extractor / rds.py
index 8c016a77dea1122286d3eafb5475686a9f4e17ea..975b091aaf4bb8d9c0fb25ca6b76ae7b24054044 100644 (file)
@@ -1,32 +1,29 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 from .common import InfoExtractor
 from ..utils import (
+    js_to_json,
     parse_duration,
     parse_iso8601,
-    js_to_json,
 )
-from ..compat import compat_str
 
 
 class RDSIE(InfoExtractor):
+    _WORKING = False
     IE_DESC = 'RDS.ca'
     _VALID_URL = r'https?://(?:www\.)?rds\.ca/vid(?:[eé]|%C3%A9)os/(?:[^/]+/)*(?P<id>[^/]+)-\d+\.\d+'
 
     _TESTS = [{
-        'url': 'http://www.rds.ca/videos/football/nfl/fowler-jr-prend-la-direction-de-jacksonville-3.1132799',
+        # has two 9c9media ContentPackages, the web player selects the first ContentPackage
+        'url': 'https://www.rds.ca/videos/Hockey/NationalHockeyLeague/teams/9/forum-du-5-a-7-jesperi-kotkaniemi-de-retour-de-finlande-3.1377606',
         'info_dict': {
-            'id': '604333',
-            'display_id': 'fowler-jr-prend-la-direction-de-jacksonville',
+            'id': '2083309',
+            'display_id': 'forum-du-5-a-7-jesperi-kotkaniemi-de-retour-de-finlande',
             'ext': 'flv',
-            'title': 'Fowler Jr. prend la direction de Jacksonville',
-            'description': 'Dante Fowler Jr. est le troisième choix du repêchage 2015 de la NFL. ',
-            'timestamp': 1430397346,
-            'upload_date': '20150430',
-            'duration': 154.354,
-            'age_limit': 0,
-        }
+            'title': 'Forum du 5 à 7 : Kotkaniemi de retour de Finlande',
+            'description': 'md5:83fa38ecc4a79b19e433433254077f25',
+            'timestamp': 1606129030,
+            'upload_date': '20201123',
+            'duration': 773.039,
+        },
     }, {
         'url': 'http://www.rds.ca/vid%C3%A9os/un-voyage-positif-3.877934',
         'only_matching': True,
@@ -38,7 +35,7 @@ def _real_extract(self, url):
         webpage = self._download_webpage(url, display_id)
 
         item = self._parse_json(self._search_regex(r'(?s)itemToPush\s*=\s*({.+?});', webpage, 'item'), display_id, js_to_json)
-        video_id = compat_str(item['id'])
+        video_id = str(item['id'])
         title = item.get('title') or self._og_search_title(webpage) or self._html_search_meta(
             'title', webpage, 'title', fatal=True)
         description = self._og_search_description(webpage) or self._html_search_meta(
@@ -59,7 +56,7 @@ def _real_extract(self, url):
             '_type': 'url_transparent',
             'id': video_id,
             'display_id': display_id,
-            'url': '9c9media:rds_web:%s' % video_id,
+            'url': f'9c9media:rds_web:{video_id}',
             'title': title,
             'description': description,
             'thumbnail': thumbnail,