Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xvideos] Add support for alternative urls. #22471

Merged
merged 3 commits into from
Oct 4, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion youtube_dl/extractor/xvideos.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class XVideosIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://
(?:
(?:www\.)?xvideos\.com/video|
(?:(?:fr|it|de|www)\.)?xvideos2?\.com/video|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are more country domains.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are more country domains

When I wrote the regex, I used the html code from the https://xvideos.com main page. A part from 'fr', 'it' and 'de' xvideos.com subdomains and xvideos.es there were no other country domains.
All other countries lead to www.xvideos2.com.

Here is an excerpt from this html code (as of 2019-09-28)

<link rel="alternate" href="https://www.xvideos.com/" hreflang="x-default" />
<link rel="alternate" href="https://www.xvideos2.com/" hreflang="en-IN" />
<link rel="alternate" href="https://www.xvideos2.com/" hreflang="hi" />
<link rel="alternate" href="https://www.xvideos2.com/" hreflang="bn" />
<link rel="alternate" href="https://www.xvideos2.com/" hreflang="mr" />
<link rel="alternate" href="https://www.xvideos2.com/" hreflang="te" />
<link rel="alternate" href="https://www.xvideos2.com/" hreflang="ta" />
<link rel="alternate" href="https://www.xvideos2.com/" hreflang="kn" />
<link rel="alternate" href="https://www.xvideos2.com/" hreflang="gu" />
<link rel="alternate" href="https://www.xvideos2.com/" hreflang="or" />
<link rel="alternate" href="https://www.xvideos2.com/" hreflang="ml" />
<link rel="alternate" href="https://www.xvideos.es/" hreflang="es" />
<link rel="alternate" href="https://fr.xvideos.com/" hreflang="fr" />
<link rel="alternate" href="https://it.xvideos.com/" hreflang="it" />
<link rel="alternate" href="https://de.xvideos.com/" hreflang="de" />

As of this writing, https://www.xvideos.cm/ exists. However it seems to be a chaturbate like website. xvideos.desi is a parked domain.

@dstftw Do you see any other country domain needing to be added?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jp also exists

(?:www\.)?xvideos\.es/video|
flashservice\.xvideos\.com/embedframe/|
static-hw\.xvideos\.com/swf/xv-player\.swf\?.*?\bid_video=
)
Expand All @@ -39,6 +40,42 @@ class XVideosIE(InfoExtractor):
}, {
'url': 'http://static-hw.xvideos.com/swf/xv-player.swf?id_video=4588838',
'only_matching': True,
}, {
'url': 'http://xvideos.com/video4588838/biker_takes_his_girl',
'only_matching': True
}, {
'url': 'https://xvideos.com/video4588838/biker_takes_his_girl',
'only_matching': True
}, {
'url': 'https://xvideos.es/video4588838/biker_takes_his_girl',
'only_matching': True
}, {
'url': 'https://www.xvideos.es/video4588838/biker_takes_his_girl',
'only_matching': True
}, {
'url': 'http://xvideos.es/video4588838/biker_takes_his_girl',
'only_matching': True
}, {
'url': 'http://www.xvideos.es/video4588838/biker_takes_his_girl',
'only_matching': True
}, {
'url': 'http://fr.xvideos.com/video4588838/biker_takes_his_girl',
'only_matching': True
}, {
'url': 'https://fr.xvideos.com/video4588838/biker_takes_his_girl',
'only_matching': True
}, {
'url': 'http://it.xvideos.com/video4588838/biker_takes_his_girl',
'only_matching': True
}, {
'url': 'https://it.xvideos.com/video4588838/biker_takes_his_girl',
'only_matching': True
}, {
'url': 'http://de.xvideos.com/video4588838/biker_takes_his_girl',
'only_matching': True
}, {
'url': 'https://de.xvideos.com/video4588838/biker_takes_his_girl',
'only_matching': True
}]

def _real_extract(self, url):
Expand Down