diff --git a/youtube_dl/extractor/xhamster.py b/youtube_dl/extractor/xhamster.py
index 52f8ded2f..68652a22f 100644
--- a/youtube_dl/extractor/xhamster.py
+++ b/youtube_dl/extractor/xhamster.py
@@ -75,6 +75,10 @@ class XHamsterIE(InfoExtractor):
'params': {
'skip_download': True,
},
+ }, {
+ # mobile site
+ 'url': 'https://m.xhamster.com/videos/cute-teen-jacqueline-solo-masturbation-8559111',
+ 'only_matching': True,
}, {
'url': 'https://xhamster.com/movies/2272726/amber_slayed_by_the_knight.html',
'only_matching': True,
@@ -93,7 +97,8 @@ def _real_extract(self, url):
video_id = mobj.group('id') or mobj.group('id_2')
display_id = mobj.group('display_id') or mobj.group('display_id_2')
- webpage = self._download_webpage(url, video_id)
+ desktop_url = re.sub(r'^(https?://(?:.+?\.)?)m\.', r'\1', url)
+ webpage = self._download_webpage(desktop_url, video_id)
error = self._html_search_regex(
r'
]+id=["\']videoClosed["\'][^>]*>(.+?)
',
@@ -229,8 +234,8 @@ def get_height(s):
webpage, 'uploader', default='anonymous')
thumbnail = self._search_regex(
- [r'''thumb\s*:\s*(?P["'])(?P.+?)(?P=q)''',
- r'''