]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/sina.py
[ie/crunchyroll] Fix stream extraction (#10005)
[yt-dlp.git] / yt_dlp / extractor / sina.py
index aeba4e3771042354159312bdbac9ec71a5c11ed7..eeb9ebb44c9fa377b3691c920b89c862e0b0d3a7 100644 (file)
@@ -1,17 +1,17 @@
 from .common import InfoExtractor
+from ..networking import HEADRequest
 from ..utils import (
-    HEADRequest,
     ExtractorError,
+    clean_html,
+    get_element_by_attribute,
     int_or_none,
-    update_url_query,
     qualities,
-    get_element_by_attribute,
-    clean_html,
+    update_url_query,
 )
 
 
 class SinaIE(InfoExtractor):
-    _VALID_URL = r'''(?x)https?://(?:.*?\.)?video\.sina\.com\.cn/
+    _VALID_URL = r'''(?x)https?://(?:[^/?#]+\.)?video\.sina\.com\.cn/
                         (?:
                             (?:view/|.*\#)(?P<id>\d+)|
                             .+?/(?P<pseudo_id>[^/?#]+)(?:\.s?html)|
@@ -60,7 +60,7 @@ def _real_extract(self, url):
                 self.to_screen('Getting video id')
                 request = HEADRequest(url)
                 _, urlh = self._download_webpage_handle(request, 'NA', False)
-                return self._real_extract(urlh.geturl())
+                return self._real_extract(urlh.url)
             else:
                 pseudo_id = mobj.group('pseudo_id')
                 webpage = self._download_webpage(url, pseudo_id)