-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
[pornhub] Download archive improvement #31432
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Check my suggestion and otherwise this seems useful.
PornHubIE.ie_key(), video_title=title, video_id=id) | ||
for video_url, id, title in orderedSet(re.findall( | ||
r'href="/?(view_video\.php\?.*\bviewkey=([\da-z]+)[^"]*)"[^>]*\s+title="([^"]+)"', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, if extracting the ID, that's the primary key on which we should be filtering.
seen_ids = set()
for m in re.finditer(
r'href="/?(view_video\.php\?.*\bviewkey=([\da-z]+)[^"]*)"[^>]*\s+title="([^"]+)"',
container):
v_url, v_id, title = m.group(1, 2, 3)
if v_id in seen_ids:
continue
yield self.url_result(
'http://www.%s/%s' % (host, v_url),
PornHubIE.ie_key(), video_title=title, video_id=v_id)
seen_ids.add(v_id)
Anyhow, avoid a variable id
since that has a specific meaning in Python.
PornHubIE.ie_key(), video_title=title, video_id=id) | |
for video_url, id, title in orderedSet(re.findall( | |
r'href="/?(view_video\.php\?.*\bviewkey=([\da-z]+)[^"]*)"[^>]*\s+title="([^"]+)"', | |
PornHubIE.ie_key(), video_title=title, video_id=v_id) | |
for video_url, v_id, title in orderedSet(re.findall( | |
r'href="/?(view_video\.php\?.*\bviewkey=([\da-z]+)[^"]*)"[^>]*\s+title="([^"]+)"', |
Also, the question as to why orderedSet()
, which is de-duplicated but not sorted, got its name arises ...
Thx: * MrBigDig <mrbigdig2020@gmail.com> * yt-dlp contributors. Supersedes, closes #31432.
Please follow the guide below
x
into all the boxes [ ] relevant to your pull request (like that [x])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:
What is the purpose of your pull request?
Description of your pull request and other information
PornHub video metadata is downloaded while downloading playlist even though video id is present in archive file.
This happens because PornoHub playlist extractor doesn't extract video id and video id is needed to check presence in archive. With video id exported downloading new videos from playlists happens faster.
Example (before):
First attempt downloads metadata and video. Second attempt downloads only metadata.
Example (after):