Skip to main content

yt_tui/
lib.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2// Copyright (c) 2026 Enzo Costa Fuke
3
4//! `yt-tui` is a terminal YouTube player: search via `yt-dlp`, playback
5//! via a single long-lived `mpv` instance controlled over its IPC socket,
6//! interface with `ratatui`, all orchestrated asynchronously with
7//! `tokio`.
8//!
9//! This crate is published primarily as the `yt-tui` binary (see
10//! `src/main.rs` and `docs/USAGE.md` in the repository for the controls
11//! and how to run it). The modules below are also exposed as a library in
12//! case you want to reuse the YouTube-search / mpv-IPC / history plumbing
13//! for a different frontend.
14//!
15//! # Modules
16//!
17//! - [`yt`] — searches YouTube via `yt-dlp` and streams results back.
18//! - [`mpv`] — controls a single `mpv` instance over its JSON IPC socket.
19//! - [`history`] — persists watched/queued videos to `history.toml`.
20//! - [`app`] — ties the above together into the [`app::App`] state machine
21//!   that drives the TUI.
22//! - [`ui`] — renders [`app::App`]'s state with `ratatui`.
23//!
24//! # External dependencies
25//!
26//! This crate shells out to two binaries that must be installed and on
27//! the `PATH`:
28//!
29//! - [`yt-dlp`](https://github.com/yt-dlp/yt-dlp) — search and stream
30//!   resolution.
31//! - [`mpv`](https://mpv.io/) — audio/video playback, controlled via its
32//!   [JSON IPC protocol](https://mpv.io/manual/stable/#json-ipc).
33//!
34//! See `docs/USAGE.md` in the repository for installation instructions.
35
36#![warn(missing_docs)]
37
38pub mod app;
39pub mod history;
40pub mod mpv;
41pub mod ui;
42pub mod yt;