Statistics
- New `stats` module computes totals, top-N channels, per-year upload
histogram, and per-week download activity from the in-memory library
+ watched/positions data.
- GET /api/stats endpoint returns the full report as JSON.
- Web UI: 📊 button in the header opens a stats modal with summary
tiles, two CSS bar charts (weeks + years), and side-by-side top-N
tables.
- Desktop GUI: 📊 Stats toggle in the top bar opens a window with
the same data, rendered via egui rects (stdlib calendar math so
there's no chrono dep).
- Bar chart helper `draw_bars` is reusable across stats sections.
Source URL (AGPL §13)
- `web.source_url` is now editable in both Settings UIs — was
previously documented-only and required hand-editing config.toml.
- Settings POST persists it and the footer link updates immediately.
- Default config.toml ships with the Codeberg URL set.
SECURITY_AUDIT.md
- Re-audited the codebase as of commit
|
||
|---|---|---|
| .vscode | ||
| src | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| icon.png | ||
| LICENSE | ||
| PKGBUILD | ||
| README.md | ||
| SECURITY_AUDIT.md | ||
| youtube-backup.desktop | ||
| yt-offline-0.1.0-1-x86_64.pkg.tar.zst | ||
yt-offline
A desktop app for archiving YouTube channels using yt-dlp. Browse your downloaded channels, manage downloads, and play videos — all from a native GUI.
Features
- Channel Browser — Browse downloaded channels and videos with thumbnails
- Smart Download Routing — Paste any YouTube URL; channels, playlists, and single videos are automatically routed to the right folder
- Playlist View — Channels with playlist subdirectories show them in the sidebar
- Themes — Dark, Light, Dracula, Trans, and three Emo/Scene themes
- Settings GUI — Configure everything from inside the app
- Video Playback — Launch videos in mpv, VLC, or any player
- Search — Filter across your entire library in real time
- System Tray — Minimize to tray
Building
Arch Linux / Manjaro
A PKGBUILD is included:
git clone https://codeberg.org/anassaeneroi/yt-offline
cd yt-offline
makepkg -si
Or build manually:
sudo pacman -S --needed rust yt-dlp mpv
cargo build --release
sudo install -Dm755 target/release/yt-offline /usr/bin/yt-offline
Debian / Ubuntu / Linux Mint
Install build dependencies:
sudo apt install \
build-essential pkg-config curl git \
libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev \
libxkbcommon-dev libssl-dev \
libgtk-3-dev libayatana-appindicator3-dev
Install Rust (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
Install runtime dependencies:
sudo apt install yt-dlp mpv
Build and install:
git clone https://codeberg.org/anassaeneroi/yt-offline
cd yt-offline
cargo build --release
sudo install -Dm755 target/release/yt-offline /usr/bin/yt-offline
cp youtube-backup.desktop ~/.local/share/applications/yt-offline.desktop
macOS
Install Xcode command line tools and Homebrew dependencies:
xcode-select --install
brew install yt-dlp mpv
Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
Build:
git clone https://codeberg.org/anassaeneroi/yt-offline
cd yt-offline
cargo build --release
The binary is at target/release/yt-offline. Copy it wherever you like, or run it in place.
Windows
-
Install Rust — accept the default MSVC toolchain when prompted
-
Install Visual Studio Build Tools with the Desktop development with C++ workload
-
Install yt-dlp and mpv:
winget install yt-dlp.yt-dlp winget install mpv.net -
Clone and build:
git clone https://codeberg.org/anassaeneroi/yt-offline cd yt-offline cargo build --release
The binary is at target\release\yt-offline.exe. Copy it wherever you like and run it.
Note: The first build takes a while — Rust compiles all dependencies from scratch.
Configuration
On first run, create a config.toml next to the binary (or edit it from the Settings button inside the app):
[backup]
directory = "/path/to/your/video/library"
[player]
command = "mpv"
[ui]
theme = "dark"
Options
| Setting | Default | Description |
|---|---|---|
backup.directory |
./channels |
Where downloaded videos are stored |
player.command |
mpv |
Command used to launch the video player |
ui.theme |
dark |
dark, light, dracula, trans, emo-nocturnal, emo-coffin, emo-scene-queen |
Usage
-
Download a channel/video/playlist — click ⬇ Downloads, paste a YouTube URL. The app detects the URL type and routes it automatically:
- Channel URL →
channels/<handle>/ - Single video →
channels/<channel-name>/ - Playlist →
channels/<channel-name>/<playlist-name>/
- Channel URL →
-
Browse your library — channels appear in the left sidebar. If a channel has playlist subdirectories they show as collapsible sub-items.
-
Play a video — click ▶ Play on any video card, or double-click the thumbnail.
-
Change settings — click ⚙ Settings to change the backup directory, player, or theme without editing the file.
Troubleshooting
yt-dlp not found
Make sure it's installed and on your $PATH. On Windows, restart your terminal after install.
Build fails on Debian/Ubuntu with missing headers
Make sure you installed all packages in the build dependencies block above, especially libayatana-appindicator3-dev and libgtk-3-dev.
Build fails on Windows with linker errors Make sure Visual Studio Build Tools are installed with the C++ workload selected, not just the base tools.
Videos won't play
Check player.command in config.toml (or Settings). The command must accept a file path as its last argument.
Thumbnails not loading Supported formats: JPEG, PNG, WebP. Other formats are silently skipped.
Project Structure
src/
main.rs entry point
app.rs UI and main loop
downloader.rs yt-dlp integration and URL detection
library.rs channel/playlist/video scanner
config.rs config file loading and saving
theme.rs all colour themes
database.rs SQLite (reserved for future use)
tray.rs system tray
License
See LICENSE.