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

[Xhamster] Updated regex to accommodate new video_id with letters #25804

Merged
merged 6 commits into from
Aug 12, 2020
Merged
Changes from 5 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
7 changes: 5 additions & 2 deletions youtube_dl/extractor/xhamster.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class XHamsterIE(InfoExtractor):
https?://
(?:.+?\.)?%s/
(?:
movies/(?P<id>\d+)/(?P<display_id>[^/]*)\.html|
videos/(?P<display_id_2>[^/]*)-(?P<id_2>\d+)
movies/(?P<id>[\dA-z]+)/(?P<display_id>[^/]*)\.html|
videos/(?P<display_id_2>[^/]*)-(?P<id_2>[\dA-z]+)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I've already pointed out: if you include any non alphanumeric characters add tests for such cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My bad, i meant for it to only be a alphanumeric regex

Copy link
Contributor

Choose a reason for hiding this comment

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

Do I see it correctly that the problem is that a test for the movie URLs is still missing?

Unfortunately I have not seen any URLs with included ../movie/... for a long time. The video ID with letters is only since 1 to 2 months.

Can't we maybe first make the change for ../videos/... until someone finds a suitable link for the test with ../movies/...?

)
''' % _DOMAINS
_TESTS = [{
Expand Down Expand Up @@ -105,6 +105,9 @@ class XHamsterIE(InfoExtractor):
}, {
'url': 'http://xhamster.com/movies/2221348/britney_spears_sexy_booty.html?hd',
'only_matching': True,
}, {
'url': 'http://de.xhamster.com/videos/skinny-girl-fucks-herself-hard-in-the-forest-xhnBJZx',
'only_matching': True,
}]

def _real_extract(self, url):
Expand Down