Repository navigation
fix(media): name a stream after its folder when its playlist name is generic - #627
Conversation
…generic HLS and DASH downloads took the playlist's name: Apple's example saved as master.mp4, Shaka's angel-one as dash.mp4, and Unified Streaming's .../tears-of-steel.ism/.m3u8 as media.ts. When the playlist's name only says it is a playlist (master, index, playlist, manifest, dash, ...) or is empty, the stream is now named after the nearest of the two folders above it that names something, without a Smooth Streaming .ism: never a signed path's token or a number. Names are percent-decoded too.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e448d74697
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Found while downloading public HLS/DASH streams: outputs were named after the playlist file, which for most streams says nothing.
…/img_bipbop_adv_example_fmp4/master.m3u8(Apple)master.mp4img_bipbop_adv_example_fmp4.mp4…/shaka-demo-assets/angel-one/dash.mpddash.mp4angel-one.mp4…/tears-of-steel/tears-of-steel.ism/.m3u8(Unified Streaming)media.tstears-of-steel.ts…/x36xhzz/x36xhzz.m3u8(Mux),…/bbb_30fps.mpd(Akamai)What changes
MediaDownloadHelper.resolvenames the output with the newmediaName(url): the playlist's name, percent-decoded, unless it is empty or generic (master,index,playlist,manifest,main,media,stream,prog_index,chunklist,dash,hls,video,audio,output, …). In that case it uses the nearest of the two folders above it that names something: not generic, containing a letter, at most 64 characters, and without=,~or,, so a signed path's token (exp=…~hmac=…) or a numeric ID never becomes a file name. A Smooth Streaming.ism/.ismlsuffix is dropped. Otherwise the old name stays (index,master,media). Files the user names are unaffected.Verification
ketchfrom this branch saves Apple's stream asimg_bipbop_adv_example_fmp4.mp4, angel-one asangel-one.mp4and Unified Streaming's astears-of-steel.ts.MediaDownloadHelperTest.mediaName_genericPlaylists_takeTheirFoldersNamecovers those URLs, Mux, a percent-encoded folder, numeric and token folders, and an empty name. The existing HLS/DASH naming tests (index.ts,master.mp4with no folder) are unchanged../gradlew :library:core:jvmTest --tests '*MediaDownloadHelperTest*' :library:hls:jvmTest :library:dash:jvmTestpasses.