mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-02 17:22:31 +01:00
[xhamster] Fix extraction (closes #24205)
This commit is contained in:
parent
50d19895a1
commit
b274e48d56
@ -113,7 +113,7 @@ def _real_extract(self, url):
|
|||||||
display_id = mobj.group('display_id') or mobj.group('display_id_2')
|
display_id = mobj.group('display_id') or mobj.group('display_id_2')
|
||||||
|
|
||||||
desktop_url = re.sub(r'^(https?://(?:.+?\.)?)m\.', r'\1', url)
|
desktop_url = re.sub(r'^(https?://(?:.+?\.)?)m\.', r'\1', url)
|
||||||
webpage = self._download_webpage(desktop_url, video_id)
|
webpage, urlh = self._download_webpage_handle(desktop_url, video_id)
|
||||||
|
|
||||||
error = self._html_search_regex(
|
error = self._html_search_regex(
|
||||||
r'<div[^>]+id=["\']videoClosed["\'][^>]*>(.+?)</div>',
|
r'<div[^>]+id=["\']videoClosed["\'][^>]*>(.+?)</div>',
|
||||||
@ -161,6 +161,9 @@ def get_height(s):
|
|||||||
'ext': determine_ext(format_url, 'mp4'),
|
'ext': determine_ext(format_url, 'mp4'),
|
||||||
'height': get_height(quality),
|
'height': get_height(quality),
|
||||||
'filesize': filesize,
|
'filesize': filesize,
|
||||||
|
'http_headers': {
|
||||||
|
'Referer': urlh.geturl(),
|
||||||
|
},
|
||||||
})
|
})
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user