diff --git a/yt_dlp/extractor/generic.py b/yt_dlp/extractor/generic.py index 22cdc0d63c..f512757c54 100644 --- a/yt_dlp/extractor/generic.py +++ b/yt_dlp/extractor/generic.py @@ -1628,29 +1628,6 @@ class GenericIE(InfoExtractor): 'thumbnail': r're:https?://downloads\.intercomcdn\.com/.+\.jpg', }, 'playlist_count': 2, - }, { - # 🔧122 - # XHamsterEmbedIE - 'url': 'https://xhamster.com/awards/2023', - 'info_dict': { - 'id': 'xh2VnYn', - 'ext': 'mp4', - 'title': 'xHamster Awards 2023 - The Winners', - 'age_limit': 18, - 'comment_count': int, - 'description': '', - 'display_id': 'xhamster-awards-2023-the-winners', - 'duration': 292, - 'thumbnail': r're:https?://ic-vt-nss\.xhcdn\.com/.+', - 'timestamp': 1700122082, - 'upload_date': '20231116', - 'uploader': 'xHamster', - 'uploader_id': 'xhamster', - 'uploader_url': 'https://xhamster.com/users/xhamster', - 'view_count': int, - }, - 'params': {'skip_download': 'm3u8'}, - 'skip': 'IE fix required; embed detection', }, { # ✅124 # YoutubeIE diff --git a/yt_dlp/extractor/xhamster.py b/yt_dlp/extractor/xhamster.py index 3cbe27f613..7640e6c065 100644 --- a/yt_dlp/extractor/xhamster.py +++ b/yt_dlp/extractor/xhamster.py @@ -43,7 +43,7 @@ class XHamsterIE(InfoExtractor): 'uploader_id': 'ruseful2011', 'duration': 893, 'age_limit': 18, - 'thumbnail': 'https://thumb-nss.xhcdn.com/a/u3Vr5F2vvcU3yK59_jJqVA/001/509/445/1280x720.8.jpg', + 'thumbnail': r're:https?://.+\.jpg', 'uploader_url': 'https://xhamster.com/users/ruseful2011', 'description': '', 'view_count': int, @@ -63,11 +63,12 @@ class XHamsterIE(InfoExtractor): 'age_limit': 18, 'description': '', 'view_count': int, - 'thumbnail': 'https://thumb-nss.xhcdn.com/a/kk5nio_iR-h4Z3frfVtoDw/002/221/348/1280x720.4.jpg', + 'thumbnail': r're:https?://.+\.jpg', 'comment_count': int, }, 'params': { - 'skip_download': True, + 'extractor_args': {'generic': {'impersonate': ['chrome']}}, + 'skip_download': 'm3u8', }, }, { # empty seo, unavailable via new URL schema @@ -86,11 +87,9 @@ class XHamsterIE(InfoExtractor): 'uploader_url': 'https://xhamster.com/users/parejafree', 'description': '', 'view_count': int, - 'thumbnail': 'https://thumb-nss.xhcdn.com/a/xc8MSwVKcsQeRRiTT-saMQ/005/667/973/1280x720.2.jpg', - }, - 'params': { - 'skip_download': True, + 'thumbnail': r're:https?://.+\.jpg', }, + 'skip': 'Invalid URL', }, { # mobile site 'url': 'https://m.xhamster.com/videos/cute-teen-jacqueline-solo-masturbation-8559111', @@ -390,19 +389,48 @@ def get_height(s): class XHamsterEmbedIE(InfoExtractor): _VALID_URL = rf'https?://(?:[^/?#]+\.)?{XHamsterIE._DOMAINS}/xembed\.php\?video=(?P\d+)' _EMBED_REGEX = [r']+?src=(["\'])(?P(?:https?:)?//(?:www\.)?xhamster\.com/xembed\.php\?video=\d+)\1'] - _TEST = { + _TESTS = [{ 'url': 'http://xhamster.com/xembed.php?video=3328539', 'info_dict': { 'id': '3328539', 'ext': 'mp4', 'title': 'Pen Masturbation', + 'comment_count': int, + 'description': '', + 'display_id': 'pen-masturbation', 'timestamp': 1406581861, 'upload_date': '20140728', 'uploader': 'ManyakisArt', 'duration': 5, 'age_limit': 18, + 'thumbnail': r're:https?://.+\.jpg', + 'uploader_id': 'manyakisart', + 'uploader_url': 'https://xhamster.com/users/manyakisart', + 'view_count': int, }, - } + }] + _WEBPAGE_TESTS = [{ + 'url': 'https://xhamster.com/awards/2023', + 'info_dict': { + 'id': 'xh2VnYn', + 'ext': 'mp4', + 'title': 'xHamster Awards 2023 - The Winners', + 'age_limit': 18, + 'comment_count': int, + 'description': '', + 'display_id': 'xhamster-awards-2023-the-winners', + 'duration': 292, + 'thumbnail': r're:https?://ic-vt-nss\.xhcdn\.com/.+', + 'timestamp': 1700122082, + 'upload_date': '20231116', + 'uploader': 'xHamster', + 'uploader_id': 'xhamster', + 'uploader_url': 'https://xhamster.com/users/xhamster', + 'view_count': int, + }, + 'params': {'skip_download': 'm3u8'}, + 'skip': 'IE fix required; embed detection', + }] def _real_extract(self, url): video_id = self._match_id(url) @@ -437,13 +465,13 @@ class XHamsterUserIE(InfoExtractor): 'info_dict': { 'id': 'firatkaan', }, - 'playlist_mincount': 1, + 'playlist_mincount': 0, }, { 'url': 'https://xhamster.com/creators/squirt-orgasm-69', 'info_dict': { 'id': 'squirt-orgasm-69', }, - 'playlist_mincount': 150, + 'playlist_mincount': 46, }, { 'url': 'https://xhday.com/users/mobhunter', 'only_matching': True,