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

Conversation

Stephan972
Copy link
Contributor

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

ytdl doesn't recognize xvideos urls like the one below :
https://fr.xvideos.com/video13287221/
Did you notice the 'fr' subdomain before 'xvideos.com' domain ?

This patch addresses this issue and other alternative valid xvideos urls rejected by youtube-dl.
xvideos2.com, xvideos.es, it.xvideos.com, de.xvideos.com.

@Stephan972 Stephan972 changed the title Add support for alternative xvideos urls. [xvideos] Add support for alternative xvideos urls. Sep 21, 2019
@Stephan972 Stephan972 changed the title [xvideos] Add support for alternative xvideos urls. [xvideos] Add support for alternative urls. Sep 21, 2019
@@ -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

@dstftw dstftw merged commit 4e72d02 into ytdl-org:master Oct 4, 2019
meunierd referenced this pull request in meunierd/youtube-dl Feb 13, 2020
pareronia referenced this pull request in pareronia/youtube-dl Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants