fix(m3u): preserve catchup seek parameter names#473
Conversation
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-473.eastasia.1.azurestaticapps.net |
8b48eec to
27960b7
Compare
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-473.eastasia.1.azurestaticapps.net |
There was a problem hiding this comment.
Pull request overview
Fixes a regression in M3U catchup URL rewriting where single “range” seek parameters (e.g., tvdr=begin-end) were being rewritten to playseek=... before reaching the built-in web player, while keeping playseek as the carrier for path templates and unrecognized query-template params. Also ensures URL-supplied r2h-token does not leak upstream (HTTP/RTSP) case-insensitively.
Changes:
- Extend URL template analysis to detect “single range seek param in query” and preserve the original/bound seek parameter name when appropriate (
tvdror explicitly declared viar2h-seek-name). - Update M3U catchup query injection to use the preserved seek param name (falling back to
playseek). - Strip
r2h-tokenfrom upstream HTTP/RTSP URLs case-insensitively; add E2E coverage for seek-name semantics and token stripping.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/url_template.h | Adds analysis fields to track query range param + chosen seek param name. |
| src/url_template.c | Detects range templates in a single query param; selects seek carrier name based on builtin/explicit seek-name. |
| src/m3u.c | Uses analyzed seek param name when generating catchup template query (tvdr=... vs playseek=...). |
| src/service.c | Makes query-param matching case-insensitive and strips r2h-token from upstream RTSP/HTTP URLs. |
| e2e/test_url_template.py | Adds tests ensuring tvdr and explicit custom seek names are preserved in rewritten M3U catchup-source URLs. |
| e2e/test_rtsp_seek_mode.py | Adds tests ensuring configured seek-name doesn’t remap request playseek, and r2h-token doesn’t leak to RTSP upstream. |
| e2e/test_http_proxy.py | Adds test ensuring r2h-token is stripped before upstream HTTP requests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Remove copy_query_param_name, reuse copy_template_value instead - Move query_param_name and query_param_has_range out of public struct into locals — they are internal bookkeeping for seek_param_name - Treat overlong param names as "skip" instead of hard failure so analysis falls back to playseek gracefully
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-473.eastasia.1.azurestaticapps.net |
1 similar comment
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-473.eastasia.1.azurestaticapps.net |
Summary
Fixes a 3.12.0 catchup rewrite regression where M3U
catchup-sourceURLs using a meaningful single range seek parameter such astvdr=begin-endwere rewritten toplayseek=begin-endbefore reaching the built-in web player.Root Cause
The URL template refactor introduced a unified
playseekcarrier for all dynamic catchup query templates. That is still needed for path templates and split query templates so the server can resolve placeholders and apply seek offsets, but it was too broad for single range seek parameters that the server already understands or that are explicitly declared withr2h-seek-name.Changes
tvdr=begin-endin rewritten M3U catchup URLs.r2h-seek-name.playseek=begin-endas the carrier for path templates and unrecognized query template parameters.r2h-seek-nameselects what to consume but does not rename a request-suppliedplayseekparameter.r2h-tokenfrom upstream HTTP and RTSP requests, case-insensitively.Validation
git diff --cached --checkcmake --build build -j$(getconf _NPROCESSORS_ONLN)./scripts/run-e2e.sh -p 1 test_url_template.py./scripts/run-e2e.sh -p 1 test_rtsp_seek_mode.py./scripts/run-e2e.sh -p 1 test_http_proxy.py./scripts/run-e2e.sh -p 1 test_m3u.py./scripts/run-e2e.sh -p 1 test_auth.pyFixes #471