1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-07-27 07:38:30 +00:00

XHamsterEmbedIE

This commit is contained in:
doe1080 2025-07-16 15:15:34 +09:00
parent c231459d6d
commit 3061a76f71
2 changed files with 39 additions and 34 deletions

View File

@ -1628,29 +1628,6 @@ class GenericIE(InfoExtractor):
'thumbnail': r're:https?://downloads\.intercomcdn\.com/.+\.jpg', 'thumbnail': r're:https?://downloads\.intercomcdn\.com/.+\.jpg',
}, },
'playlist_count': 2, '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 # ✅124
# YoutubeIE # YoutubeIE

View File

@ -43,7 +43,7 @@ class XHamsterIE(InfoExtractor):
'uploader_id': 'ruseful2011', 'uploader_id': 'ruseful2011',
'duration': 893, 'duration': 893,
'age_limit': 18, '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', 'uploader_url': 'https://xhamster.com/users/ruseful2011',
'description': '', 'description': '',
'view_count': int, 'view_count': int,
@ -63,11 +63,12 @@ class XHamsterIE(InfoExtractor):
'age_limit': 18, 'age_limit': 18,
'description': '', 'description': '',
'view_count': int, '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, 'comment_count': int,
}, },
'params': { 'params': {
'skip_download': True, 'extractor_args': {'generic': {'impersonate': ['chrome']}},
'skip_download': 'm3u8',
}, },
}, { }, {
# empty seo, unavailable via new URL schema # empty seo, unavailable via new URL schema
@ -86,11 +87,9 @@ class XHamsterIE(InfoExtractor):
'uploader_url': 'https://xhamster.com/users/parejafree', 'uploader_url': 'https://xhamster.com/users/parejafree',
'description': '', 'description': '',
'view_count': int, 'view_count': int,
'thumbnail': 'https://thumb-nss.xhcdn.com/a/xc8MSwVKcsQeRRiTT-saMQ/005/667/973/1280x720.2.jpg', 'thumbnail': r're:https?://.+\.jpg',
},
'params': {
'skip_download': True,
}, },
'skip': 'Invalid URL',
}, { }, {
# mobile site # mobile site
'url': 'https://m.xhamster.com/videos/cute-teen-jacqueline-solo-masturbation-8559111', 'url': 'https://m.xhamster.com/videos/cute-teen-jacqueline-solo-masturbation-8559111',
@ -390,19 +389,48 @@ def get_height(s):
class XHamsterEmbedIE(InfoExtractor): class XHamsterEmbedIE(InfoExtractor):
_VALID_URL = rf'https?://(?:[^/?#]+\.)?{XHamsterIE._DOMAINS}/xembed\.php\?video=(?P<id>\d+)' _VALID_URL = rf'https?://(?:[^/?#]+\.)?{XHamsterIE._DOMAINS}/xembed\.php\?video=(?P<id>\d+)'
_EMBED_REGEX = [r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?xhamster\.com/xembed\.php\?video=\d+)\1'] _EMBED_REGEX = [r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?xhamster\.com/xembed\.php\?video=\d+)\1']
_TEST = { _TESTS = [{
'url': 'http://xhamster.com/xembed.php?video=3328539', 'url': 'http://xhamster.com/xembed.php?video=3328539',
'info_dict': { 'info_dict': {
'id': '3328539', 'id': '3328539',
'ext': 'mp4', 'ext': 'mp4',
'title': 'Pen Masturbation', 'title': 'Pen Masturbation',
'comment_count': int,
'description': '',
'display_id': 'pen-masturbation',
'timestamp': 1406581861, 'timestamp': 1406581861,
'upload_date': '20140728', 'upload_date': '20140728',
'uploader': 'ManyakisArt', 'uploader': 'ManyakisArt',
'duration': 5, 'duration': 5,
'age_limit': 18, '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): def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)
@ -437,13 +465,13 @@ class XHamsterUserIE(InfoExtractor):
'info_dict': { 'info_dict': {
'id': 'firatkaan', 'id': 'firatkaan',
}, },
'playlist_mincount': 1, 'playlist_mincount': 0,
}, { }, {
'url': 'https://xhamster.com/creators/squirt-orgasm-69', 'url': 'https://xhamster.com/creators/squirt-orgasm-69',
'info_dict': { 'info_dict': {
'id': 'squirt-orgasm-69', 'id': 'squirt-orgasm-69',
}, },
'playlist_mincount': 150, 'playlist_mincount': 46,
}, { }, {
'url': 'https://xhday.com/users/mobhunter', 'url': 'https://xhday.com/users/mobhunter',
'only_matching': True, 'only_matching': True,