From a9cef44c2939f3f468e3a236e3dc21d0a718e483 Mon Sep 17 00:00:00 2001 From: rag-hav Date: Sun, 3 May 2020 15:17:32 +0530 Subject: [PATCH] Try all hosts --- youtube_dl/extractor/xvideos.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/youtube_dl/extractor/xvideos.py b/youtube_dl/extractor/xvideos.py index 74332c21b..224e711bc 100644 --- a/youtube_dl/extractor/xvideos.py +++ b/youtube_dl/extractor/xvideos.py @@ -87,12 +87,13 @@ class XVideosIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) - webpage = self._download_webpage( - 'https://www.xvideos.com/video%s/' % video_id, video_id, fatal=False) - - if not webpage: + HOSTS = ('xvideos', 'xvideos2', 'xvideos3') + self.report_download_webpage(video_id) + for host in HOSTS: webpage = self._download_webpage( - 'https://www.xvideos3.com/video%s/' % video_id, video_id) + 'https://www.' + host + '.com/video%s/' % video_id, video_id, note=False, fatal=host == HOSTS[-1], errnote=host == HOSTS[-1]) + if webpage: + break mobj = re.search(r'

(.+?)

', webpage) if mobj: