Skip to content

fix: defer -sv resolution validation for single m3u8 stream#853

Open
andya1lan wants to merge 2 commits intonilaoda:mainfrom
andya1lan:fix/sv-res-single-m3u8-validation
Open

fix: defer -sv resolution validation for single m3u8 stream#853
andya1lan wants to merge 2 commits intonilaoda:mainfrom
andya1lan:fix/sv-res-single-m3u8-validation

Conversation

@andya1lan
Copy link

Summary

Fix -sv resolution select behavior for single stream m3u8 inputs by deferring validation until actual media info is available.

Changes

Keep single stream candidates when playlist resolution metadata is missing.
Validate the resolution parameter against probed video resolution after media info is read.
Fail gracefully with user-friendly error messages.

Result

Master m3u8: filter behavior unchanged.
Single m3u8: matches continue; mismatches fail clearly and safely.

Copilot AI review requested due to automatic review settings February 12, 2026 18:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes -sv res filtering behavior for single-stream HLS playlists that lack RESOLUTION metadata by deferring resolution validation until FFmpeg media info is available during download.

Changes:

  • Update resolution filtering to keep the lone candidate when playlist resolution metadata is missing (single-stream m3u8).
  • Add post-probe validation of -sv res against FFmpeg-detected video resolution and emit clearer error messages.
  • Add new localized resource strings for resolution mismatch reporting.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/N_m3u8DL-RE/Util/FilterUtil.cs Defers ResolutionReg filtering when there’s exactly one candidate and its resolution is missing.
src/N_m3u8DL-RE/DownloadManager/SimpleDownloadManager.cs Adds resolution validation after media info probing and stops the stream download on mismatch.
src/N_m3u8DL-RE.Common/Resource/StaticText.cs Introduces new localized strings for the resolution mismatch error.
src/N_m3u8DL-RE.Common/Resource/ResString.cs Exposes the new resource keys through ResString.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ameters

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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