[youtube] Fix JS player URL extraction
authorSergey M․ <dstftw@gmail.com>
Sat, 31 Oct 2020 23:52:00 +0000 (06:52 +0700)
committerSergey M․ <dstftw@gmail.com>
Sat, 31 Oct 2020 23:52:00 +0000 (06:52 +0700)
youtube_dl/extractor/youtube.py

index bd151538061e0a69e5c10e2673e5e3a6bb7c01dd..c31731ac0755d7e88434a7fb13f2642ba7d7938a 100644 (file)
@@ -2086,7 +2086,10 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
 
                 if cipher:
                     if 's' in url_data or self._downloader.params.get('youtube_include_dash_manifest', True):
-                        ASSETS_RE = r'"assets":.+?"js":\s*("[^"]+")'
+                        ASSETS_RE = (
+                            r'<script[^>]+\bsrc=("[^"]+")[^>]+\bname=["\']player_ias/base',
+                            r'"jsUrl"\s*:\s*("[^"]+")',
+                            r'"assets":.+?"js":\s*("[^"]+")')
                         jsplayer_url_json = self._search_regex(
                             ASSETS_RE,
                             embed_webpage if age_gate else video_webpage,