diff options
author | Sergey M․ <dstftw@gmail.com> | 2020-03-01 20:04:48 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2020-03-01 20:04:48 +0700 |
commit | b274e48d56cced250f5abbc88b4cda2e5b4338d0 (patch) | |
tree | 8dcebcf9ec54a91bcfcb73d1909cb076313d485a | |
parent | 50d19895a1a3515d48dc952bf9280cbdc4f405f9 (diff) |
[xhamster] Fix extraction (closes #24205)
-rw-r--r-- | youtube_dl/extractor/xhamster.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/extractor/xhamster.py b/youtube_dl/extractor/xhamster.py index a5b94d279..0f7be6a7d 100644 --- a/youtube_dl/extractor/xhamster.py +++ b/youtube_dl/extractor/xhamster.py @@ -113,7 +113,7 @@ class XHamsterIE(InfoExtractor): display_id = mobj.group('display_id') or mobj.group('display_id_2') 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( r'<div[^>]+id=["\']videoClosed["\'][^>]*>(.+?)</div>', @@ -161,6 +161,9 @@ class XHamsterIE(InfoExtractor): 'ext': determine_ext(format_url, 'mp4'), 'height': get_height(quality), 'filesize': filesize, + 'http_headers': { + 'Referer': urlh.geturl(), + }, }) self._sort_formats(formats) |