fix(m3u): support multiple URL lines under a single #EXTINF - #746
Merged
Conversation
A #EXTINF followed by several URL lines describes one channel with multiple sources. The converter only consumed the first URL and silently dropped the rest, so such channels lost all but one source in the transformed playlist. Keep the entry open after the first URL and re-emit the EXTINF line for each additional URL-looking line, so every source gets its own service path. Closes #740 Co-authored-by: Stackie Jia <jsq2627@gmail.com>
…hannel sources The player parser reset the pending EXTINF after the first URL line, so a second URL under the same #EXTINF was ignored instead of becoming another source of the channel. Co-authored-by: Stackie Jia <jsq2627@gmail.com>
Co-authored-by: Stackie Jia <jsq2627@gmail.com>
Contributor
Documentation previewThe documentation preview has been deployed for this pull request. |
…lti-source form Co-authored-by: Stackie Jia <jsq2627@gmail.com>
Write the EXTINF line once and list the rewritten URLs directly beneath it instead of re-emitting EXTINF per URL, so the transformed playlist mirrors the source playlist. The blank separator between entries is deferred until the next tag so single-URL output is unchanged. Co-authored-by: Stackie Jia <jsq2627@gmail.com>
…URLs Co-authored-by: Stackie Jia <jsq2627@gmail.com>
stackia
marked this pull request as ready for review
September 5, 2026 02:07
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_e53f5288-b28c-4425-8c03-5d0fb3ff2e6f) |
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.
Closes #740
Problem
An M3U entry written as one
#EXTINFfollowed by several URL lines lost every URL except the first:Both layers were affected:
src/m3u.c:in_entrywas reset after the first URL, so the second URL was silently dropped from the transformed/playlist.m3uand no service was created for it.web-ui/src/lib/m3u-parser.ts:currentExtinfwas reset after the first URL, so the player parsed such an entry as a single-source channel.Fix
scheme://...or/path) under the same#EXTINFgets its own service path (.../Channel/label, or.../Channel/2,/3when unlabelled). The transformed playlist preserves the input shape: the#EXTINFline is written once and the rewritten URLs follow it; entries that repeat#EXTINFstay repeated. The blank separator between entries is deferred until the next tag so single-URL output is byte-identical to before.catchup-sourcelives on the one#EXTINFline, so the catchup service is created and rewritten once (against the first source). Stray non-URL text after an entry is still ignored.#EXTINFare appended as sources of the same channel.#EXTINFfollowed by multiple URL lines is the documented way to declare a multi-source channel; the example output shows the converted playlist keeping that structure.Tests
parseM3U(multi-URL entry, mixing with repeated#EXTINF, catchup propagation, orphan URL lines).TestM3UMultiURLPerEXTINFine2e/test_m3u.py: shape preserved with every URL rewritten, unlabelled URLs get unique paths, repeated-#EXTINFinput stays repeated, catchup rewritten once for a multi-URL entry, stray text ignored.pnpm run lint,tsc --noEmit,pnpm run web-ui:test, andpnpm run docs:buildpass locally; all CI checks green.Manual check
Web player against the fixed binary with the issue's playlist form:
Channel 3is listed once, its source menu shows线路1/线路2, and an unlabelled three-URL entry showsSource 1/Source 2/Source 3.