]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/motorsport.py
[ie/crunchyroll] Fix stream extraction (#10005)
[yt-dlp.git] / yt_dlp / extractor / motorsport.py
index c9d1ab64dc36f12940ff6fee6f92524ce4ae3f2e..167d85fa9b9ce5f37ca98fc329e9c135379d2492 100644 (file)
@@ -1,6 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
 from .common import InfoExtractor
 from ..compat import (
     compat_urlparse,
@@ -8,6 +5,7 @@
 
 
 class MotorsportIE(InfoExtractor):
+    _WORKING = False
     IE_DESC = 'motorsport.com'
     _VALID_URL = r'https?://(?:www\.)?motorsport\.com/[^/?#]+/video/(?:[^/?#]+/)(?P<id>[^/]+)/?(?:$|[?#])'
     _TEST = {
@@ -34,8 +32,13 @@ def _real_extract(self, url):
         webpage = self._download_webpage(url, display_id)
 
         iframe_path = self._html_search_regex(
-            r'<iframe id="player_iframe"[^>]+src="([^"]+)"', webpage,
-            'iframe path')
+            r'<iframe id="player_iframe"[^>]+src="([^"]+)"', webpage, 'iframe path', default=None)
+
+        if iframe_path is None:
+            iframe_path = self._html_search_regex(
+                r'<iframe [^>]*\bsrc="(https://motorsport\.tv/embed/[^"]+)', webpage, 'embed iframe path')
+            return self.url_result(iframe_path)
+
         iframe = self._download_webpage(
             compat_urlparse.urljoin(url, iframe_path), display_id,
             'Downloading iframe')