mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2025-01-09 06:37:54 +01:00
Try all hosts
This commit is contained in:
parent
9b2e251a00
commit
a9cef44c29
@ -87,12 +87,13 @@ class XVideosIE(InfoExtractor):
|
|||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
webpage = self._download_webpage(
|
HOSTS = ('xvideos', 'xvideos2', 'xvideos3')
|
||||||
'https://www.xvideos.com/video%s/' % video_id, video_id, fatal=False)
|
self.report_download_webpage(video_id)
|
||||||
|
for host in HOSTS:
|
||||||
if not webpage:
|
|
||||||
webpage = self._download_webpage(
|
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'<h1 class="inlineError">(.+?)</h1>', webpage)
|
mobj = re.search(r'<h1 class="inlineError">(.+?)</h1>', webpage)
|
||||||
if mobj:
|
if mobj:
|
||||||
|
Loading…
Reference in New Issue
Block a user