From 1f2c50dbe8ba47c8852f3adefd51136d26f00075 Mon Sep 17 00:00:00 2001 From: DonneyF Date: Sat, 9 Jan 2021 18:41:13 -0800 Subject: [PATCH] [youtube] Fix XSRF Token regex --- youtube_dlc/extractor/youtube.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dlc/extractor/youtube.py b/youtube_dlc/extractor/youtube.py index e0f211b74..773d289ca 100644 --- a/youtube_dlc/extractor/youtube.py +++ b/youtube_dlc/extractor/youtube.py @@ -2374,7 +2374,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor): video_annotations = None if self._downloader.params.get('writeannotations', False): xsrf_token = self._search_regex( - r'([\'"])XSRF_TOKEN\1\s*:\s*([\'"])(?P[A-Za-z0-9+/=]+)\2', + r'([\'"])XSRF_TOKEN\1\s*:\s*([\'"])(?P(?:(?!\2).)+)\2', video_webpage, 'xsrf token', group='xsrf_token', fatal=False) invideo_url = try_get( player_response, lambda x: x['annotations'][0]['playerAnnotationsUrlsRenderer']['invideoUrl'], compat_str)