Repository navigation
mpv-http-range-cache: Persistent HTTP 206 byte-range disk cache & cross-URL watch_later sync #18816
Arsks12
started this conversation in
Show and tell
Replies: 1 comment
Update —
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone — I built mpv-http-range-cache so
mpvnever has to re-download remote HTTP/HTTPS streams when rewinding, restarting playback, or opening expired/mirror links.Why?
mpv's native demuxer cache (--cache=yes) lives in RAM and disappears as soon as you exit (or when old chunks rotate out).mpv-http-range-cachepersists downloaded HTTP206byte ranges on disk inside sparse per-video subfolders so cache hits stream straight from SSD/HDD—even offline.Key Highlights
FSCTL_SET_SPARSEon NTFS / sparse on POSIX): Scrubbing to the end of a large remote MKV only consumes disk blocks for the ranges you actually streamed, stored cleanly under<cache_dir>/<filename>/cache.data+cache.meta.json.on_load/on_load_failhooking: Runs at priority50(afterytdl_hookat10) and restores original URL/proxy options at priority5on failure. Skips localhost loopback and.m3u8/.mpd/.plsmanifests automatically.watch_latersync: Matches identical files served from different hosts/signed URLs via exacttotal_size+ SHA-256 of the first 64 KB (match_by_content=yes), aliases them to the same cache folder, and syncssave-position-on-quit=yesacross URL changes.mpv.confhttp-proxy,tls-verify, andnetwork-timeoutvia strippedX-Mpv-Cache-*headers while bypassinghttp-proxyfor local127.0.0.1loopback connections.uoscintegration: Includes unbound bindings (cache-status,clear-current-cache,clear-all-cache,toggle-cache) that work standalone or with#!comments inuosc.Repo, install scripts (
windows.ps1/unix.sh), architecture deep dive, and tests:-> https://github.com/Arsks12/mpv-http-range-cache
Feedback and contributions are welcome!
All reactions