rstube
A terminal app for playing YouTube videos through mpv, with per-video
position tracking and playlist-aware pickers.
What it does
- Reads one or more YouTube playlists and/or individually-configured videos you’ve set up.
- Shows a TUI picker to pick something to watch — filtered by what you haven’t seen yet, or unfiltered, or only videos you were partway through.
- Launches
mpvwith the right resume position. - Records where you left off so you can resume next time.
- Lets you forget a video you’ve watched so it cycles back into the “new” pool.
What it doesn’t do
- Download videos. It streams through mpv via
yt-dlp. - Talk to the YouTube API for authenticated data. Your YouTube account’s per-video watch progress isn’t accessible; rstube tracks positions locally from mpv sessions only.
- Manage mpv itself. Keybindings, output config, subs — that lives in your
~/.config/mpv/. See mpv configuration.
How it works
yt-dlp --flat-playlistfetches a playlist’s video list in ~1s. Cached to$XDG_STATE_HOME/rstube/playlist_cache.jsonfor 24 hours.- The TUI picker (ratatui + crossterm) shows the filtered list.
- On Enter, rstube spawns
mpv <url> --start=<resume-secs>and streams mpv’s IPC to write the current position to$XDG_STATE_HOME/rstube/positions.redb. - On mpv exit, a line is appended to
history.jsonl.
Requirements
mpv(system package)yt-dlp(Python package)
Run rstube install-deps to install whichever is missing.