Repository navigation
fix: play separate HLS audio tracks - #1967
Conversation
Some hianime titles ship audio as separate EXT-X-MEDIA renditions, so the selected quality variant was video only and played silently. - Pick the DEFAULT=YES audio rendition from the master playlist - Pass it as external audio to mpv, IINA, VLC and syncplay - Mux it into downloads with ffmpeg instead of yt-dlp - Bump version to 5.1.6 Fixes pystardust#1960
| command -v "yt-dlp" >/dev/null && yt-dlp --referer "$refr" "$1" --no-skip-unavailable-fragments --fragment-retries infinite -N 16 -o "$download_dir/$_name.mp4" $3 && return 0 | ||
| ffmpeg -extension_picky 0 -referer "$refr" -loglevel error -stats -i "$1" -c copy "$download_dir/$_name.mp4" $3 | ||
| [ -z "$audio_link" ] && command -v "yt-dlp" >/dev/null && yt-dlp --referer "$refr" "$1" --no-skip-unavailable-fragments --fragment-retries infinite -N 16 -o "$download_dir/$_name.mp4" $3 && return 0 | ||
| ffmpeg -extension_picky 0 -referer "$refr" -loglevel error -stats -i "$1" ${audio_link:+-extension_picky 0 -referer "$refr" -i "$audio_link"} -c copy "$download_dir/$_name.mp4" $3 |
There was a problem hiding this comment.
-extension_picky 0 is not recognized by the FFmpeg 7.1 Windows build, so downloads fail with “Unrecognized option”. Could this flag be removed or used only when supported? The separate audio muxing works without it, preserving compatibility with older FFmpeg versions.
There was a problem hiding this comment.
The flag is older than this PR, master added it in #1545 because the host serves .ts.jpg segments and ffmpeg 7.1.1 and newer reject them without it (checked n7.1.1, n7.1.2 and n8.0, all have the option and the check on by default).
Only the original 7.1 build lacks it, a 7.1.x update fixes that. Making it conditional would be a separate change.
|
I'll treat |
rorozco-rynoh
left a comment
There was a problem hiding this comment.
Code looks good tested with Nina Liston Merciless Maiden
|
Also I have the fix applied in my local script and its working |
|
If you want the fix before it is merged, you only need the one script file from the PR branch. Dependencies are the same as master. Linux, macOS, Termux Or with git: If you already have a clone of this repo: Windows Same commands in Git Bash. From PowerShell Scoop users can copy the file over Check and play
Do not run Notes on the choices:
|
…, release 0.6.5 (#13) - shows whose audio is a separate track (Cyberpunk: Edgerunners 2) downloaded without sound with ani-cli 5.1; with an ani-cli that has pystardust/ani-cli#1967 they download through ffmpeg, which a stand-in ffmpeg makes write a .part file, renamed only when ffmpeg finished without skipped segments, dropped connections or errors, and report how far it got; a video-only download is deleted and reported as having no sound - one "Downloads…" per show instead of "Download episodes…" and "Delete downloads…": every episode with its state (not downloaded, queued, downloading with progress, on disk with its size, queued in another ani-hop); enter downloads, stops or deletes after asking, and marked episodes in different states ask which - downloads can be stopped: the episode leaves the queue, the running one is killed and its partial files deleted - the queue lives in memory, written through to its file; the worker re-reads it before each episode, and what's on disk or queued is never downloaded again - the footer's download line ends in "…" before the key hints

Type of change
Description
Fixes #1960.
Some titles ship their audio as separate
EXT-X-MEDIArenditions in the master playlist (Overgeared ep 2 from the issue, The Laid-Off Cheat-Granting Mage on the sub and the dub server). The parser dropped those lines, so the selected quality was a video-only playlist and mpv played in silence. Titles with muxed audio were never affected, which is why it looked random.hianime_m3u8now keeps theDEFAULT=YESaudio rendition (Japanese on sub, English on dub) inaudio_linkand the players get it next to the subtitles:--audio-filefor mpv, flatpak mpv and syncplay,--mpv-audio-filesfor IINA,:input-slavefor VLC,audio-file=in the Android mpv include. Downloads of these titles go through ffmpeg with the audio as second input, yt-dlp cannot merge an external playlist. Nothing changes for muxed titles. catt, iSH and VLC on Android take no second input and still get the video-only variant.Related: #1962 (subtitle lang is always
en) is a separate bug in the same provider path. #1909 was sudo + pipewire, #1964 is the other way round (video missing). None of those is touched here.Tested on Windows with mpv: the reported anime plays with sound in sub and dub,
-d -q 360pgives an mp4 with h264 and Japanese AAC over the full 23:40, One Piece (muxed audio) behaves as before. VLC, IINA, syncplay and Android follow the documented options, not tested here.Checklist
-chistory and continue work-ddownloads work-e(select episode) aka-r(range selection) works-Sselect index works-qquality works-ssyncplay works (not installed)-vvlc works (not installed)--duband regular (sub) mode both work--nextep-countdowncountdown to next ep works-hhelp info is up to dateAdditional Testcases
--skipani-skip works--no-detachno detach works--exit-after-playauto exit after playing works