r/mpv • u/HalfEnvironmental744 • 21d ago
User Scripts & Shaders [Release] mpv-http-range-cache v2.0.0 — Fully Async aiohttp + Parallel Multi-Connection HTTP Disk Cache for mpv
I built mpv-http-range-cache, a persistent HTTP 206 byte-range disk cache & cross-URL watch_later resume proxy for mpv, and just shipped v2.0.0 — an end-to-end non-blocking async pipeline from main.lua down to socket streaming and disk storage.
Why I built it
By default, mpv's demuxer cache lives in RAM and disappears as soon as you close the player or evict older chunks. Watching long or high-bitrate HTTP streams meant re-downloading previously watched parts on re-opens, rewinds, or when CDN signed links expired.
What's New in v2.0.0
- Fully Async
aiohttpProxy & Pooled Connections (proxy.py): Persistentaiohttp.ClientSessionwith DNS caching and keep-alive pooling. - Parallel Multi-Connection Sliding-Window Downloads: Splits uncached
Rangegaps across 4 concurrent connections (2 MBparts by default, configurable) with zero-duplicate cold-start probe handoff. - Zero-Blocking Disk & Lua Paths: Cache chunk I/O, atomic metadata saves, 64 KB SHA-256 content dedup checks, LRU eviction, and
watch_latersync run off the event loop viaasyncio.to_thread, whilemain.luausesmp.command_native_asynceverywhere (including detachedend-fileresume persistence). - Sparse Files + Cross-URL Resume: NTFS/POSIX sparse files (
FSCTL_SET_SPARSE), clean per-video subfolders (Movie.mkv/cache.data), proxy/VPN header forwarding (http-proxy,tls-verify), and content-based deduplication so rotating links reuse both your cached bytes andsave-position-on-quittimestamp.
Links
- GitHub Repo & Installers (Windows / macOS / Linux): https://github.com/Arsks12/mpv-http-range-cache
- v2.0.0 Release Notes: https://github.com/Arsks12/mpv-http-range-cache/releases/tag/v2.0.0
6
Upvotes
4
u/Arbeitsloeffel 21d ago
Yes, these are definitely words.