From f706db27943f3a2c304105804a6fd49cbd18d4f0 Mon Sep 17 00:00:00 2001 From: Captain Pirate Date: Tue, 27 Oct 2020 21:01:13 +0000 Subject: [PATCH] [youtube] Fix extraction. --- youtube_dl/extractor/youtube.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index bd1515380..bc01016e4 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -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: -- 2.39.5