Skip to content

Conversation

@mistydemeo
Copy link
Contributor

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

I haven't had a chance to test this yet.

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")) {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call.

}

{
setSkipSuperResolution(true);
Copy link
Contributor

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.

Copy link
Contributor Author

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.
Copy link
Contributor

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

Copy link
Contributor Author

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.

@mistydemeo mistydemeo force-pushed the misty/yt-dlp_filter_-sr branch from a144374 to 3e19a24 Compare January 30, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants