[Vimeo] Fix `Unable to extract info section` redux
authordirkf <fieldhouse@gmx.net>
Sat, 4 Feb 2023 00:21:35 +0000 (00:21 +0000)
committerdirkf <fieldhouse@gmx.net>
Sun, 12 Feb 2023 22:16:00 +0000 (22:16 +0000)
* as reported in yt-dlp/yt-dlp#6149
* also allow newline in target JSON object

youtube_dl/extractor/vimeo.py

index 853b3840258f6f63281656b8ad62644d70d7de0b..14f8dd034b9279134a8c02cf90dbc91d7e0b4a2d 100644 (file)
@@ -663,7 +663,7 @@ class VimeoIE(VimeoBaseInfoExtractor):
 
         if '//player.vimeo.com/video/' in url:
             config = self._parse_json(self._search_regex(
-                r'\b(?:playerC|c)onfig\s*=\s*({.+?})\s*;', webpage, 'info section'), video_id)
+                r'(?s)\b(?:playerC|c)onfig\s*=\s*({.+?})\s*[;\n]', webpage, 'info section'), video_id)
             if config.get('view') == 4:
                 config = self._verify_player_video_password(
                     redirect_url, video_id, headers)