Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.
fix(moviebox): reject unhosted hls policies during dash manifest resolution
Samir Hossainsfb6b1e42b8f6
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex bf91c7b..211dd6e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -3,11 +3,12 @@## [Unreleased]### Fixed+- **Providers & Stream Resolution**:+ - Filtered out unhosted MovieBox `/hls/` signed cookie targets in manifest resolution, which stops unplayable H.264 stream entries from failing with HTTP 404 during downloads or media playback.- **Download Engine & Batch Queue**:- Fixed season batch downloads by arming `is_waiting_for_download_stream` during queue steps, eliminating immediate empty-list download calls that aborted multi-episode queues.- Reset the download resolution state lock on 4KHDHub resolver timeouts and errors so failed mirror resolutions do not block subsequent download attempts.- Added sequential single-connection fallback to the internal HTTP downloader when multi-worker segmented range requests receive HTTP 403, 429, or network disconnects.-### Added- **In-App Updater Lifecycle**:- Tracked target executable path before staging updates and resolved deleted inode suffixes (` (deleted)`) on Linux to restart the new binary automatically after popup self-update.diff --git a/docs/providers.md b/docs/providers.mdindex 29129e3..4127253 100644--- a/docs/providers.md+++ b/docs/providers.md@@ -39,3 +39,7 @@ pub trait Provider: Send + Sync {```New providers implement `Provider` (and optionally `ReleaseProvider` for multi-mirror streams), then register in `src/service.rs`. Responses are automatically cached as MessagePack envelopes.++### MovieBox CDN Manifest Resolution++MovieBox CDN stream entries parse signed `CloudFront-Policy` and `Edge-Cache-Cookie` tokens to find stream roots. The manifest resolver accepts only `/dash/` resources. Unhosted legacy `/hls/` cookie targets are dropped to prevent 404 failures during playback or downloads.diff --git a/src/providers/moviebox/adapt.rs b/src/providers/moviebox/adapt.rsindex 26cc907..55d1478 100644--- a/src/providers/moviebox/adapt.rs+++ b/src/providers/moviebox/adapt.rs@@ -572,7 +572,10 @@ pub fn is_deprecation_notice_url(url: &str) -> bool {fn to_dash_mpd(url_str: &str) -> Option<String> {let base = url_str.trim_end_matches('*').trim_end_matches('/');- if !base.is_empty() && (base.starts_with("http://") || base.starts_with("https://")) {+ if !base.is_empty()+ && (base.starts_with("http://") || base.starts_with("https://"))+ && base.contains("/dash/")+ {Some(format!("{base}/index.mpd"))} else {None@@ -1101,6 +1104,8 @@ mod tests {Some(expected));}+ let hls_cookie = "Edge-Cache-Cookie=urlprefix=aHR0cHM6Ly9zYmNkbjMuaGFrdW5heW1hdGF0YS5jb20vaGxzLzUyODM0MjAzNzkzODAzMzU1NzYtMS0xLTcyMC05NDYv:sign=9d668fe770e7d41d067f80422544d47e:t=1791308037";+ assert_eq!(resolve_dash_manifest_from_policy(hls_cookie), None);}#[test]@@ -1163,6 +1168,30 @@ mod tests {"Deprecation notice MP4 must be rejected");}+ #[test]+ fn test_hls_signed_policy_rejected_as_dash_manifest() {+ let payload = json!({+ "code": 0,+ "data": {+ "title": "Shark: The Storm",+ "displayResolutions": "720",+ "streams": [+ {+ "id": "1886864337231398728",+ "format": "MP4",+ "codecName": "h264",+ "resolutions": "720",+ "size": "198337682",+ "duration": 1595,+ "url": "https://macdn.aoneroom.com/other/2026/09/04/b164fbfb4347792950bdfbfb563d39d9.mp4",+ "signCookie": "Edge-Cache-Cookie=urlprefix=aHR0cHM6Ly9zYmNkbjMuaGFrdW5heW1hdGF0YS5jb20vaGxzLzQwNDIzMTc5OTc2NzAyNDg1Ni0xLTEtNzIwLTk3NC8:sign=abc:t=1791308126"+ }+ ]+ }+ });+ let releases = moviebox_play_info_json_to_releases(&payload, 1, 1, "TestAgent/1.0");+ assert!(releases.is_empty());+ }#[test]fn test_legitimate_direct_stream_url_fallback_preserved() {