Repository navigation
Conversation
resolve_url joined every non-absolute URI onto the playlist's directory, so a root-relative segment (/hls/v1/seg0.ts) became https://host/path//hls/v1/seg0.ts and a protocol-relative one (//cdn2.host/seg0.ts) became https://host/path///cdn2.host/seg0.ts. Both are valid in a playlist (RFC 8216 4.1 resolves URIs per RFC 3986), and the same function resolves variant playlists and AES key URIs. Root-relative URIs now resolve against the playlist's origin and keep the playlist's query, like other relative segments. Protocol-relative URIs take the playlist's scheme and no query, like absolute ones. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
HEOJUNFO
force-pushed
the
fix/hls-root-relative-uri
branch
from
November 15, 2026 05:20
d184001 to
ceb805f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolve_urlin the HLS downloader joined every non-absolute URI onto the playlist's directory. Two valid forms came out wrong:https://cdn.example.com/path/master.m3u8/hls/v1/seg0.tshttps://cdn.example.com/path//hls/v1/seg0.tshttps://cdn.example.com/hls/v1/seg0.tshttps://cdn.example.com/path/master.m3u8//cdn2.example.com/seg0.tshttps://cdn.example.com/path///cdn2.example.com/seg0.tshttps://cdn2.example.com/seg0.tsThe same function resolves segments, the variant playlist picked from a master, and AES key URIs, so a playlist that uses either form fails at whichever of those it hits first.
url_origin, already in this file) and keep the playlist's query string, like other relative segments do.Plain relative and absolute URIs are unchanged; the existing tests cover those.
Tested with
cargo test -p libreget-core --lib hls_downloader(40 passed). The three new tests fail ondevwith the "Before" values above.cargo fmt --checkis clean and clippy reports nothing in this file. I did not run a download against a live playlist that uses these forms.🤖 Generated with Claude Code