| Crates.io | youtube_chapter_splitter |
| lib.rs | youtube_chapter_splitter |
| version | 0.14.6 |
| created_at | 2025-11-06 12:06:28.844763+00 |
| updated_at | 2026-01-21 16:53:21.686793+00 |
| description | Download YouTube videos, extract audio to MP3, and split by chapters with automatic metadata tagging |
| homepage | https://github.com/all3f0r1/youtube-chapter-splitter |
| repository | https://github.com/all3f0r1/youtube-chapter-splitter |
| max_upload_size | |
| id | 1919523 |
| size | 332,804 |
ytcs: Download complete YouTube albums, cleanly split into MP3 tracks with metadata and cover art, all via a single command line.
youtube-chapter-splitter (or ytcs) is a powerful and pragmatic CLI tool designed for one thing: archiving music from YouTube perfectly. It downloads the video, extracts audio to MP3, fetches the cover art, cleans titles, and splits the audio into pristine tracks based on chapters, all in a single command.
ytcs v0.14.5
→ Paradox - Chemical Love Theory
21m 47s • 5 tracks
Downloading the album...
✓ Cover downloaded
⏓ [==============================>] 100% | 45.2MiB | 2.34MiB/s | ETA: 00:00
✓ Audio downloaded
Refining chapter markers with silence detection...
Chapter refinement report:
Title Original → Refined (Delta)
----------------------------------------------------------------------
1. Light Years Apart 0.0s → 0.0s (— )
2. Event Horizon 250.0s → 249.8s (-0.2s )
3. Orbit of Silence 294.5s → 295.1s (+0.6s )
4. Chemical Love Theory 348.0s → 347.9s (-0.1s )
5. Singularity Within 403.0s → 403.0s (— )
Average adjustment: 0.09s | Max adjustment: 0.60s
Splitting into the album...
✓ 01 - Light Years Apart
✓ 02 - Event Horizon
✓ 03 - Orbit of Silence
✓ 04 - Chemical Love Theory
✓ 05 - Singularity Within
✓ Done → /home/alex/Music/Paradox - Chemical Love Theory
00:00 - Track Title1 - Track Title (0:00)config.toml file for your preferences.%n, %t, %a, %A) and folders (%a, %A).[Full Album], (Official Audio), etc.ytcs <URL> without the download command.yt-dlp and ffmpeg are checked at startup.RUST_LOG environment variable.ytcs requires two external tools:
Quick install:
# Linux/macOS (via package manager)
# Ubuntu/Debian
sudo apt install yt-dlp ffmpeg
# macOS (via Homebrew)
brew install yt-dlp ffmpeg
# Or via pip (cross-platform)
pip install yt-dlp
# Windows (via Chocolatey)
choco install yt-dlp ffmpeg
Download the latest release for your system from the Releases page.
Linux/macOS:
# Download, extract, and install
wget https://github.com/all3f0r1/youtube-chapter-splitter/releases/latest/download/ytcs-x86_64-unknown-linux-gnu.tar.gz
tar xzf ytcs-x86_64-unknown-linux-gnu.tar.gz
sudo mv ytcs /usr/local/bin/
# Verify installation
ytcs --version
Windows:
ytcs-x86_64-pc-windows-msvc.zip.ytcs.exe.PATH.cargocargo install youtube_chapter_splitter
Note for macOS users: Pre-compiled Linux binaries won't work on macOS due to different architectures. You need to compile from source:
# Clone the repository
git clone https://github.com/all3f0r1/youtube-chapter-splitter.git
cd youtube-chapter-splitter
# Build in release mode
cargo build --release
# Install the binary
sudo cp target/release/ytcs /usr/local/bin/
# Verify installation
ytcs --version
For Linux users, you can also build from source using the same commands above.
ytcs works with clear and direct commands.
The simplest way to use ytcs:
# Direct URL (recommended)
ytcs "https://www.youtube.com/watch?v=..."
# Explicit download command (also works)
ytcs download "https://www.youtube.com/watch?v=..."
Download options:
-o, --output <DIR>: Specify an output folder.-a, --artist <ARTIST>: Force the artist name.-A, --album <ALBUM>: Force the album name.--no-cover: Disable cover art download.--refine-chapters: Enable chapter refinement with silence detection (default: true).--no-refine-chapters: Disable chapter refinement.Examples:
# Basic usage
ytcs "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
# Custom output directory
ytcs -o ~/Downloads/Music "https://youtube.com/..."
# Override artist and album
ytcs -a "Pink Floyd" -A "The Wall" "https://youtube.com/..."
# Skip cover art
ytcs --no-cover "https://youtube.com/..."
# Disable chapter refinement (faster, less precise splits)
ytcs --no-refine-chapters "https://youtube.com/..."
ytcs includes structured logging for troubleshooting. Control log verbosity with the RUST_LOG environment variable:
# Show debug logs (very verbose, includes all operations)
RUST_LOG=debug ytcs "https://youtube.com/..."
# Show info logs (important events only)
RUST_LOG=info ytcs "https://youtube.com/..."
# Show warnings only (default)
ytcs "https://youtube.com/..."
What's logged:
Save logs to file:
RUST_LOG=debug ytcs "https://youtube.com/..." 2>&1 | tee debug.log
ytcs uses a simple configuration file (~/.config/ytcs/config.toml).
# Show current configuration
ytcs config
# Modify a value
ytcs set audio_quality 128
ytcs set playlist_behavior video_only
# Reset to default configuration
ytcs reset
Customize ytcs according to your needs. Edit the config.toml file directly or use ytcs set.
| Key | Default | Description |
|---|---|---|
default_output_dir |
~/Music |
Default output folder. |
download_cover |
true |
Download album cover art. |
filename_format |
"%n - %t" |
File name format (%n: number, %t: title, %a: artist, %A: album). |
directory_format |
"%a - %A" |
Folder format (%a: artist, %A: album). |
audio_quality |
192 |
Audio quality in kbps (e.g., 128, 192, 320). |
overwrite_existing |
false |
Re-download and overwrite existing files. |
max_retries |
3 |
Number of retry attempts on download failure. |
create_playlist |
false |
Create a .m3u playlist file for YouTube playlists. |
playlist_behavior |
ask |
Behavior for playlist URLs: ask, video_only, playlist_only. |
Format placeholders:
File format:
%n - Track number (01, 02, ...)%t - Track title%a - Artist name%A - Album nameDirectory format:
%a - Artist name%A - Album nameytcs uses a 4-level fallback system for maximum download reliability:
bestaudio[ext=m4a]/bestaudio - Best quality M4A audio (preferred)140 - YouTube's standard M4A format (very reliable)bestaudio - Generic best audio selectorThis ensures downloads work even when YouTube's signature system has issues.
See CHANGELOG.md for the complete changelog.
[0.14.5] - 2025-01-11
--refine-chapters flag to enable/disable refinement (enabled by default)[0.14.4] - 2024-12-03
[0.14.3] - 2024-12-03
[0.14.2] - 2024-12-03
[0.14.1] - 2024-12-03
[0.14.0] - 2024-12-03
process_single_url from 240+ lines to ~60 lines[0.13.0] - 2024-12-03
[0.12.0] - 2024-12-03
log and env_logger[0.11.0] - 2024-12-02
split_single_track now uses TrackSplitParams struct (reduced from 9 to 1 parameter)progress.rs module to eliminate code duplication[0.10.8] - 2024-12-02
[0.10.7] - 2024-12-02
[0.10.6] - 2024-12-02
[0.10.5] - 2024-12-01
download command[0.10.4] - 2024-12-01
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.