From: Captain Pirate Date: Tue, 27 Oct 2020 21:01:13 +0000 (+0000) Subject: [youtube] Fix extraction. X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;ds=inline;p=youtube-dl [youtube] Fix extraction. --- 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: