diff options
author | Aakash Gajjar <skyqutip@gmail.com> | 2020-08-26 20:22:32 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 20:22:32 +0530 |
commit | 19a107f21c7544b5e49a58040d09d9465f6858b1 (patch) | |
tree | 8325ffd206d9da1ce53f24b9ab4690abe175144d /youtube_dl/extractor/xhamster.py | |
parent | 7f7edf837c1af059f64a4968b942a83f86cf6206 (diff) | |
download | hypervideo-pre-19a107f21c7544b5e49a58040d09d9465f6858b1.tar.lz hypervideo-pre-19a107f21c7544b5e49a58040d09d9465f6858b1.tar.xz hypervideo-pre-19a107f21c7544b5e49a58040d09d9465f6858b1.zip |
Revert "pull changes from remote master (#190)" (#193)
This reverts commit b827ee921fe510a8730a9fab070148ed2b8279b5.
Diffstat (limited to 'youtube_dl/extractor/xhamster.py')
-rw-r--r-- | youtube_dl/extractor/xhamster.py | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/youtube_dl/extractor/xhamster.py b/youtube_dl/extractor/xhamster.py index 902a3ed33..a5b94d279 100644 --- a/youtube_dl/extractor/xhamster.py +++ b/youtube_dl/extractor/xhamster.py @@ -20,13 +20,13 @@ from ..utils import ( class XHamsterIE(InfoExtractor): - _DOMAINS = r'(?:xhamster\.(?:com|one|desi)|xhms\.pro|xhamster\d+\.com)' + _DOMAINS = r'(?:xhamster\.(?:com|one|desi)|xhms\.pro|xhamster[27]\.com)' _VALID_URL = r'''(?x) https?:// (?:.+?\.)?%s/ (?: - movies/(?P<id>[\dA-Za-z]+)/(?P<display_id>[^/]*)\.html| - videos/(?P<display_id_2>[^/]*)-(?P<id_2>[\dA-Za-z]+) + movies/(?P<id>\d+)/(?P<display_id>[^/]*)\.html| + videos/(?P<display_id_2>[^/]*)-(?P<id_2>\d+) ) ''' % _DOMAINS _TESTS = [{ @@ -100,20 +100,11 @@ class XHamsterIE(InfoExtractor): 'url': 'https://xhamster2.com/videos/femaleagent-shy-beauty-takes-the-bait-1509445', 'only_matching': True, }, { - 'url': 'https://xhamster11.com/videos/femaleagent-shy-beauty-takes-the-bait-1509445', - 'only_matching': True, - }, { - 'url': 'https://xhamster26.com/videos/femaleagent-shy-beauty-takes-the-bait-1509445', - 'only_matching': True, - }, { 'url': 'http://xhamster.com/movies/1509445/femaleagent_shy_beauty_takes_the_bait.html', 'only_matching': True, }, { 'url': 'http://xhamster.com/movies/2221348/britney_spears_sexy_booty.html?hd', 'only_matching': True, - }, { - 'url': 'http://de.xhamster.com/videos/skinny-girl-fucks-herself-hard-in-the-forest-xhnBJZx', - 'only_matching': True, }] def _real_extract(self, url): @@ -122,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, urlh = self._download_webpage_handle(desktop_url, video_id) + webpage = self._download_webpage(desktop_url, video_id) error = self._html_search_regex( r'<div[^>]+id=["\']videoClosed["\'][^>]*>(.+?)</div>', @@ -138,7 +129,7 @@ class XHamsterIE(InfoExtractor): initials = self._parse_json( self._search_regex( - r'window\.initials\s*=\s*({.+?})\s*;', webpage, 'initials', + r'window\.initials\s*=\s*({.+?})\s*;\s*\n', webpage, 'initials', default='{}'), video_id, fatal=False) if initials: @@ -170,9 +161,6 @@ class XHamsterIE(InfoExtractor): 'ext': determine_ext(format_url, 'mp4'), 'height': get_height(quality), 'filesize': filesize, - 'http_headers': { - 'Referer': urlh.geturl(), - }, }) self._sort_formats(formats) |