-
Notifications
You must be signed in to change notification settings - Fork 782
ExtractorYoutubeDL: skip YouTube super resolution videos #708
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
base: master
Are you sure you want to change the base?
ExtractorYoutubeDL: skip YouTube super resolution videos #708
Conversation
YouTube has started upscaling older videos that are below a certain resolution. yt-dlp identifies these via the `-sr` suffix in the format ID. It's probably a good idea to avoid downloading these, and just focus on the originals instead. yt-dlp's `--dump-single-json` option ignores the `--format` argument, so we can't use that to filter out super resolution videos. Instead, we'll need to check every format we get while iterating and skip it if it ends with `-sr`. See: https://alexwlchan.net/til/2025/ignore-ai-scaled-videos/?ref=mastodon
| // https://alexwlchan.net/til/2025/ignore-ai-scaled-videos/ | ||
| if ("$.format_id".equals(jsonReader.getPath()) | ||
| || jsonReader.getPath().matches("^\\$\\.entries\\[\\d+\\]\\.format_id$")) { | ||
| if (value.endsWith("-sr")) { |
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.
We probably want to make this a configurable option, with a default to not skip these, since others may want these videos.
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.
Good call.
| } | ||
|
|
||
| { | ||
| setSkipSuperResolution(true); |
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.
I think we want default to be false to maintain existing behavior by default.
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.
Done.
| return (Boolean) kp.get("skipSuperResolution"); | ||
| } | ||
| /** | ||
| * Whether or not to create a crawl.log entry for any WARC Metadata Records written. |
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.
Copy/paste typo in the comment
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.
Done, and also updated the comment lower down to reflect the fact that these are skipped by request rather than by default.
a144374 to
3e19a24
Compare
YouTube has started upscaling older videos that are below a certain resolution. yt-dlp identifies these via the
-srsuffix in the format ID. It's probably a good idea to avoid downloading these, and just focus on the originals instead.yt-dlp's
--dump-single-jsonoption ignores the--formatargument, so we can't use that to filter out super resolution videos. Instead, we'll need to check every format we get while iterating and skip it if it ends with-sr.See: https://alexwlchan.net/til/2025/ignore-ai-scaled-videos/?ref=mastodon
I haven't had a chance to test this yet.