]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[youtube] Fix extraction. master
authorCaptain Pirate <finderskeepers@pirate.bay>
Tue, 27 Oct 2020 21:01:13 +0000 (21:01 +0000)
committerCaptain Pirate <finderskeepers@pirate.bay>
Fri, 30 Oct 2020 00:54:24 +0000 (20:54 -0400)
youtube_dl/extractor/youtube.py

index bd151538061e0a69e5c10e2673e5e3a6bb7c01dd..bc01016e4376a19816be17fb454670d9b5222f6e 100644 (file)
@@ -2098,7 +2098,13 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                                 embed_webpage = self._download_webpage(
                                     embed_url, video_id, 'Downloading embed webpage')
                             jsplayer_url_json = self._search_regex(
-                                ASSETS_RE, embed_webpage, 'JS player URL')
+                                ASSETS_RE, embed_webpage, 'JS player URL (2)', default=None)
+
+                            if not jsplayer_url_json:
+                                jsplayer_url_json = self._search_regex(
+                                    r'"WEB_PLAYER_CONTEXT_CONFIG_ID_EMBEDDED_PLAYER":.+?"jsUrl":\s*("[^"]+")',
+                                    embed_webpage,
+                                    'JS player URL')
 
                         player_url = json.loads(jsplayer_url_json)
                         if player_url is None: