A terminal-based YouTube client built with Rust that allows you to:
- Authenticate with Google OAuth2
- View your subscription videos
- Play videos using mpv and yt-dlp
- Rust - Install from rustup.rs
- Windows: You'll also need a C compiler. Install MSYS2 or use the MSVC toolchain with Visual Studio Build Tools
- mpv - Video player
- Windows: Download from mpv.io
- Linux:
sudo apt install mpv(Ubuntu/Debian) orsudo pacman -S mpv(Arch) - macOS:
brew install mpv
- yt-dlp - YouTube downloader
- Windows: Download from yt-dlp releases or use
pip install yt-dlp - Linux:
sudo apt install yt-dlporpip install yt-dlp - macOS:
brew install yt-dlporpip install yt-dlp
- Windows: Download from yt-dlp releases or use
This app uses Device Authorization Flow (like SmartTube) for authentication. You need to create Google OAuth2 credentials:
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the YouTube Data API v3:
- Go to "APIs & Services" → "Library"
- Search for "YouTube Data API v3"
- Click "Enable"
- Configure OAuth Consent Screen:
- Go to "APIs & Services" → "OAuth consent screen"
- Choose "External" (unless you have Google Workspace)
- Fill in app name, support email, developer email
- Add scopes:
https://www.googleapis.com/auth/youtube.readonly - Add your email as a test user
- Create OAuth 2.0 Credentials:
- Go to "APIs & Services" → "Credentials"
- Click "+ CREATE CREDENTIALS" → "OAuth client ID"
- Application type: "TVs and Limited Input devices" (important!)
- Give it a name (e.g., "YouTube Terminal Client")
- Click "Create"
- Copy your Client ID and Client Secret
Windows PowerShell:
$env:GOOGLE_CLIENT_ID="your-client-id-here"
$env:GOOGLE_CLIENT_SECRET="your-client-secret-here"To make them permanent (Windows):
[System.Environment]::SetEnvironmentVariable("GOOGLE_CLIENT_ID", "your-client-id", "User")
[System.Environment]::SetEnvironmentVariable("GOOGLE_CLIENT_SECRET", "your-client-secret", "User")Linux/macOS:
export GOOGLE_CLIENT_ID="your-client-id-here"
export GOOGLE_CLIENT_SECRET="your-client-secret-here"To make them permanent (Linux/macOS), add to ~/.bashrc or ~/.zshrc:
export GOOGLE_CLIENT_ID="your-client-id-here"
export GOOGLE_CLIENT_SECRET="your-client-secret-here"Linux:
cargo build --release
# Or use the build script to create a self-contained AppImage:
chmod +x build.sh
./build.shNote: The build script creates a self-contained AppImage that includes all necessary libraries and can be run directly without installation:
chmod +x rustyoutube-linux-x86_64.AppImage
./rustyoutube-linux-x86_64.AppImageWindows:
cargo build --release
# Or use the build script:
.\build.ps1The project includes GitHub Actions workflows for automated builds:
-
CI Workflow (
.github/workflows/ci.yml):- Runs on every push and pull request
- Tests on Linux, Windows, and macOS
- Checks code formatting and linting
-
Build & Release Workflow (
.github/workflows/build.yml):- Triggers on version tags (e.g.,
v0.1.0) - Builds release binaries for Linux and Windows
- Creates release packages with locales and README
- Automatically creates GitHub releases with downloadable artifacts
- Triggers on version tags (e.g.,
To create a release:
# Create and push a version tag
git tag v0.1.0
git push origin v0.1.0The workflow will automatically:
- Build binaries for both platforms
- Create self-contained AppImage for Linux (
.AppImage- includes all necessary libraries) - Create ZIP package for Windows
- Create a GitHub release with download links
cargo run --releaseOr run the binary directly:
./target/release/rustyoutube- Run the program:
cargo run --release - The program will display a code and URL (e.g.,
https://www.google.com/device) - On any device (phone, tablet, another computer), visit that URL
- Enter the code shown in the terminal
- Grant permissions to access your YouTube data
- The program will automatically detect when you've authorized it
- Your token is saved for future runs
Main Menu:
r- Recommendations (YouTube trending/popular videos)s- Search videosh- Watch History (requires browser cookies)u- View Subscriptionsp- View Playlistsc- Browse Channel by URLq- Quit
In any list view:
↑/↓orj/k- NavigateEnter/Space- Select/Playr- RefreshEscorm- Back to menub- Back (in video lists)q- Quit
Video Playback: Videos will open in mpv player. Make sure mpv is installed and in your PATH.
The application tracks your watch history locally. When you play a video, it's automatically added to your history:
- Storage: History is stored in a text file (
history.txt) in the config directory - Location:
- Windows:
%APPDATA%\rustyoutube\history.txt - Linux/macOS:
~/.config/rustyoutube/history.txt
- Windows:
- Format: One video ID per line
- Limit: Maximum of 200 videos (oldest entries are removed when limit is reached)
- Order: Newest videos appear at the top
- ✅ SmartTube-style Device Authorization Flow - No browser popup, enter code on any device
- ✅ Recommendations - View trending and popular videos
- ✅ Search - Search for videos on YouTube
- ✅ Watch History - Local tracking of watched videos (up to 200 entries)
- ✅ View Subscriptions - Browse all your subscribed channels
- ✅ View Playlists - Access all your YouTube playlists
- ✅ Browse Channels - Enter any channel URL to view videos
- ✅ Terminal UI - Beautiful TUI with ratatui
- ✅ Video Playback - Play videos using mpv + yt-dlp with instant streaming
- ✅ Automatic Token Refresh - Tokens refresh automatically
- ✅ Auto-install Dependencies - mpv and yt-dlp download automatically
- ✅ Multi-language Support - English, German, Portuguese (Brazil), Spanish (Spain), French (France)
The app stores your authentication token in:
- Windows:
%APPDATA%\rustyoutube\token.json - Linux/macOS:
~/.config/rustyoutube/token.json
- "mpv not found": Make sure mpv is installed and accessible from your PATH
- "yt-dlp not found": Install yt-dlp and ensure it's in your PATH
- Authentication errors: Check your Google OAuth credentials and ensure YouTube Data API v3 is enabled
- No videos showing: Make sure you have active subscriptions on YouTube
- "No watch history found":
- History is tracked locally - play some videos first to build your history
- History file is stored in the config directory (see Configuration section)
MIT