Skip to main content

Crate yt_tui

Crate yt_tui 

Source
Expand description

yt-tui is a terminal YouTube player: search via yt-dlp, playback via a single long-lived mpv instance controlled over its IPC socket, interface with ratatui, all orchestrated asynchronously with tokio.

This crate is published primarily as the yt-tui binary (see src/main.rs and docs/USAGE.md in the repository for the controls and how to run it). The modules below are also exposed as a library in case you want to reuse the YouTube-search / mpv-IPC / history plumbing for a different frontend.

§Modules

  • yt — searches YouTube via yt-dlp and streams results back.
  • mpv — controls a single mpv instance over its JSON IPC socket.
  • history — persists watched/queued videos to history.toml.
  • app — ties the above together into the app::App state machine that drives the TUI.
  • ui — renders app::App’s state with ratatui.

§External dependencies

This crate shells out to two binaries that must be installed and on the PATH:

See docs/USAGE.md in the repository for installation instructions.

Modules§

app
Central application state: search results, history, the mpv-backed playback queue, and the glue between them.
history
Persists watched/queued videos to history.toml so they can be browsed again without re-searching YouTube.
mpv
Controls a single mpv instance over its JSON IPC socket.
ui
Renders crate::app::App’s state to the terminal with ratatui.
yt
Searches YouTube via yt-dlp and streams results back incrementally.