From bafa9d7d0190f09bc7b1b5d301cb90965df7a060 Mon Sep 17 00:00:00 2001 From: dirkf Date: Mon, 2 Oct 2023 02:46:44 +0100 Subject: [PATCH] [XHamster] Update domain list * include domains listed as trusted in page, aliased to xhamster.com * excluding domains that redirect to xhamster (eg xhday.com) --- youtube_dl/extractor/xhamster.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/youtube_dl/extractor/xhamster.py b/youtube_dl/extractor/xhamster.py index d6d8ec05e..7538b73c4 100644 --- a/youtube_dl/extractor/xhamster.py +++ b/youtube_dl/extractor/xhamster.py @@ -48,7 +48,17 @@ class XHamsterBaseIE(InfoExtractor): class XHamsterIE(XHamsterBaseIE): - _DOMAINS = r'(?:xhamster\.(?:com|one|desi)|xhms\.pro|xhamster\d+\.com|xhday\.com|xhvid\.com)' + # base domains that don't redirect to xhamster.com (not xhday\d\.com, eg) + _DOMAINS = '(?:%s)' % '|'.join(( + r'xhamster\d*\.(?:com|desi)', + r'xhamster\.one', + r'xhms\.pro', + r'xh(?:open|access|victory|big|channel)\.com', + r'(?:full|mega)xh\.com', + r'xh(?:vid|official|planet)\d*\.com', + # requires Tor + r'xhamster[a-z2-7]+\.onion', + )) _VALID_URL = r'''(?x) https?:// (?:.+?\.)?%s/ @@ -145,9 +155,7 @@ class XHamsterIE(XHamsterBaseIE): 'url': 'http://de.xhamster.com/videos/skinny-girl-fucks-herself-hard-in-the-forest-xhnBJZx', 'only_matching': True, }, { - 'url': 'https://xhday.com/videos/strapless-threesome-xhh7yVf', - 'only_matching': True, - }, { + # 'url': 'https://xhday.com/videos/strapless-threesome-xhh7yVf', 'url': 'https://xhvid.com/videos/lk-mm-xhc6wn6', 'only_matching': True, }] @@ -458,9 +466,8 @@ class XHamsterUserIE(InfoExtractor): }, 'playlist_mincount': 1, }, { - 'url': 'https://xhday.com/users/mobhunter', - 'only_matching': True, - }, { + # the below doesn't match but is redirected via generic + # 'url': 'https://xhday.com/users/mobhunter', 'url': 'https://xhvid.com/users/pelushe21', 'only_matching': True, }]