mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-25 20:55:52 +01:00
[vimeo:review] Fix config URL extraction (closes #11821)
This commit is contained in:
parent
c3a65c3de0
commit
d61aa5eb37
@ -884,10 +884,14 @@ def _real_initialize(self):
|
|||||||
|
|
||||||
def _get_config_url(self, webpage_url, video_id, video_password_verified=False):
|
def _get_config_url(self, webpage_url, video_id, video_password_verified=False):
|
||||||
webpage = self._download_webpage(webpage_url, video_id)
|
webpage = self._download_webpage(webpage_url, video_id)
|
||||||
data = self._parse_json(self._search_regex(
|
config_url = self._html_search_regex(
|
||||||
r'window\s*=\s*_extend\(window,\s*({.+?})\);', webpage, 'data',
|
r'data-config-url=(["\'])(?P<url>(?:(?!\1).)+)\1', webpage,
|
||||||
default=NO_DEFAULT if video_password_verified else '{}'), video_id)
|
'config URL', default=None, group='url')
|
||||||
config_url = data.get('vimeo_esi', {}).get('config', {}).get('configUrl')
|
if not config_url:
|
||||||
|
data = self._parse_json(self._search_regex(
|
||||||
|
r'window\s*=\s*_extend\(window,\s*({.+?})\);', webpage, 'data',
|
||||||
|
default=NO_DEFAULT if video_password_verified else '{}'), video_id)
|
||||||
|
config_url = data.get('vimeo_esi', {}).get('config', {}).get('configUrl')
|
||||||
if config_url is None:
|
if config_url is None:
|
||||||
self._verify_video_password(webpage_url, video_id, webpage)
|
self._verify_video_password(webpage_url, video_id, webpage)
|
||||||
config_url = self._get_config_url(
|
config_url = self._get_config_url(
|
||||||
|
Loading…
Reference in New Issue
Block a user