This commit is contained in:
Raghav Agarwal 2020-09-25 05:37:46 +01:00 committed by GitHub
commit 8730869dfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 3 deletions

View File

@ -17,7 +17,7 @@ class XVideosIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://
(?:
(?:[^/]+\.)?xvideos2?\.com/video|
(?:[^/]+\.)?xvideos[23]?\.com/video|
(?:www\.)?xvideos\.es/video|
flashservice\.xvideos\.com/embedframe/|
static-hw\.xvideos\.com/swf/xv-player\.swf\?.*?\bid_video=
@ -76,13 +76,29 @@ 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
}]
HOSTS = ['xvideos', 'xvideos2', 'xvideos3']
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)
self.report_download_webpage(video_id)
for i, host in enumerate(self.HOSTS):
webpage = self._download_webpage(
'https://www.' + host + '.com/video%s/' % video_id, video_id,
note=False, fatal=host == self.HOSTS[-1], errnote=host == self.HOSTS[-1])
if webpage:
temp_host = self.HOSTS[0]
self.HOSTS[0] = host
self.HOSTS[i] = temp_host
break
mobj = re.search(r'<h1 class="inlineError">(.+?)</h1>', webpage)
if mobj: