v1.2.7 — Capture mpv stderr + stream compatibility flags
What was broken
Users got mpv exited with code 2 with no explanation. SNI was throwing away mpv's stderr output (stderr=subprocess.DEVNULL), so when mpv failed the user couldn't see the actual error reason.
What's fixed
1. Capture mpv stderr
Player now pipes mpv's stdout+stderr instead of DEVNULL. When mpv fails, the error message includes the last 20 lines of mpv output so you can see WHY it failed (expired URL, format error, network issue, etc.).
2. Stream compatibility flags
Added common AllAnime playback fixes:
--ytdl=no— don't invoke yt-dlp for direct stream URLs--force-seekable=yes— allow seeking on non-seekable streams--demuxer-lavf-o=fflags=+seekable— lavf seekable flag--stream-buffer-size=4096— larger read buffer
3. Debug mode
sni --debug play "X" now shows mpv's full verbose output live in the terminal (--msg-level=all=v + --terminal=yes). The --debug flag is wired from CLI → Player constructor.
4. Better error message
When mpv fails, the StreamError now includes:
- mpv's actual output (last 20 lines)
- Common fixes list (expired URL, try --debug, different episode, etc.)
- Instead of just
mpv exited with code 2
Install
pip install --upgrade sni-cli
sni play "one piece"If playback still fails, run with debug to see full mpv output:
sni --debug play "one piece"Verified
ruff check sni/→ All checks passedpytest -q→ 44 passed (3.32s)- Live end-to-end: search → episodes → stream URL resolved
python -m build→ sdist + wheel both passtwine check
Full changelog: v1.2.6...v1.2.7