From 90f5bbf8cd02ab1258ba8f46068318c92ee12b4c Mon Sep 17 00:00:00 2001 From: rag-hav Date: Sun, 3 May 2020 13:02:20 +0530 Subject: [PATCH] Added Tests, retry with xvideos3 if xvideos fails --- youtube_dl/extractor/xvideos.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/xvideos.py b/youtube_dl/extractor/xvideos.py index 3e500c5ec..b2f2da13c 100644 --- a/youtube_dl/extractor/xvideos.py +++ b/youtube_dl/extractor/xvideos.py @@ -76,13 +76,23 @@ class XVideosIE(InfoExtractor): }, { 'url': 'https://de.xvideos.com/video4588838/biker_takes_his_girl', 'only_matching': True + }, { + 'url': 'https://www.xvideos2.com/video4588838/biker_takes_his_girl', + 'only_matching': True + }, { + 'url': 'https://www.xvideos3.com/video4588838/biker_takes_his_girl', + 'only_matching': True }] 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) + 'https://www.xvideos.com/video%s/' % video_id, video_id, fatal=False) + + if webpage == False: + webpage = self._download_webpage( + 'https://www.xvideos3.com/video%s/' % video_id, video_id) mobj = re.search(r'

(.+?)

', webpage) if mobj: