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

[ie/XVideosQuickies] Fix extractor #9834

Merged
merged 8 commits into from
May 12, 2024
Merged

Conversation

JakeFinley96
Copy link
Contributor

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

XVideos changed their quickies URL format, as such the extractor needs to be updated. The code has been checked using flake8 and the test has been updated and passes.

This pull request introduces the following modifications:

  • Updates the quickies URL transformation to conform with the new XVideos URL format https://www.xvideos.com/video.QUICKIES_ID/_.
  • Updates the quickies URL filter to be more lenient, since the quickies URL has quite a few variants (e.g. can optionally include: profiles/, amateur-channels/).
  • Updates ID match group to allow for letters as well, since XVideos updated their IDs to include letters.

Example valid URLs with this fix:

  • https://www.xvideos.com/lili_love#quickies/a/ipdtikh1a4c
  • https://www.xvideos.com/profiles/lili_love#quickies/a/ipdtikh1a4c
  • https://www.xvideos.com/amateur-channels/lili_love#quickies/a/ipdtikh1a4c

Fixes #6356

Template

Before submitting a pull request make sure you have:

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:

  • 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?

Forgot to update title field in test
@pukkandan
Copy link
Member

pukkandan commented May 1, 2024

  • (e.g. can optionally include: profiles/, amateur-channels/).

Pls add tests for each. only_matching is fine

@pukkandan
Copy link
Member

btw, is there any way to get the old numeric id of a video?

@pukkandan pukkandan added NSFW site-bug Issue with a specific website labels May 1, 2024
JakeFinley96 and others added 3 commits May 1, 2024 17:33
Implements suggested change from pukkandan

Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
This adds 2 additional tests _(for: profiles/, amateur-channels/)_, and it also fixes the first test which was incorrect... I had ran the test incorrectly so I thought it was passing, but now it is passing correctly.
Seems that the old numeric IDs still work with the old URL format. Since the old numeric IDs no longer show up on the website it would probably be safe to remove them from the extractor, but it wasn't a lot of additional code to add support for them.
@JakeFinley96
Copy link
Contributor Author

btw, is there any way to get the old numeric id of a video?

It does seem that you can still use the old video ID for downloading the videos, but the URL format must be the old one apparently... e.g. https://www.xvideos.com/video47258683/_, so It seems that they still have legacy support for the old ID. From what I can tell their whole site has moved over to the new ID so new occurrences of the old ID should not happen.

I went ahead and added support for the old numeric IDs as well, I'm not sure if it's implemented in a way that follows yt-dlp's standards, but it works and the old test passes as well.

Also the video in the old test has an updated ID now in their system, so I'm guessing they completely swapped out their IDs (old test video ID: 47258683, new ID for the same video: idhhckbf429). As such when you go to https://www.xvideos.com/video47258683/_ it turns into https://www.xvideos.com/video.idhhckbf429/verification_video.

@seproDev seproDev changed the title [XVideos] Fix quickies extractor [ie/XVideosQuickies] Fix extractor May 3, 2024
@JakeFinley96
Copy link
Contributor Author

What is the status on getting this merged? Is there something blocking this getting merged?

yt_dlp/extractor/xvideos.py Outdated Show resolved Hide resolved
JakeFinley96 and others added 2 commits May 12, 2024 21:50
Commit suggested change from pukkandan

Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
I didn't catch that the conditional check got reversed by the suggested change from Pukkandan. This fixes that regression.
@JakeFinley96
Copy link
Contributor Author

Alright the code has been updated to use isdigit() and all tests pass and flake8 shows no problems. Any further changes that are needed? Or can this be merged?

yt_dlp/extractor/xvideos.py Outdated Show resolved Hide resolved
yt_dlp/extractor/xvideos.py Outdated Show resolved Hide resolved
@JakeFinley96
Copy link
Contributor Author

LGTM 👍

@bashonly bashonly merged commit b207d26 into yt-dlp:master May 12, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NSFW site-bug Issue with a specific website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quickies on Xvideos
3 participants