Expand description
YouTube Chapter Splitter - Library for downloading and splitting YouTube videos.
This library provides tools for:
- Downloading YouTube videos and extracting audio to MP3
- Parsing chapters from YouTube metadata
- Splitting audio into individual tracks based on chapters
- Adding complete ID3 metadata and album cover art
§Example Usage
use youtube_chapter_splitter::{audio, downloader, yt_dlp_progress, Result};
use std::path::PathBuf;
fn main() -> Result<()> {
let url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ";
// Fetch video information
let video_info = downloader::get_video_info(url)?;
// Download audio with real-time progress
let output_path = PathBuf::from("temp_audio");
let audio_file = yt_dlp_progress::download_audio_with_progress(
url,
&output_path,
None, // cookies_from_browser
None, // progress bar (auto-created)
None, // shared progress for TUI
)?;
// Split by chapters
let output_dir = PathBuf::from("output");
audio::split_audio_by_chapters(
&audio_file,
&video_info.chapters,
&output_dir,
"Artist Name",
"Album Name",
None,
)?;
Ok(())
}§Modules
Re-exports§
pub use chapters::Chapter;pub use config::Config;pub use downloader::VideoInfo;pub use error::Result;pub use error::YtcsError;
Modules§
- audio
- Audio processing and chapter-based splitting.
- chapter_
refinement - Chapter refinement by silence detection.
- chapters
- YouTube video chapter management.
- chapters_
from_ description - Chapter extraction from YouTube video descriptions.
- config
- Persistent configuration management module
- cookie_
helper - Helper functions for cookie management with yt-dlp.
- dependency
- Dependency detection and installation module
- downloader
- YouTube video download and metadata extraction.
- error
- Error handling for YouTube Chapter Splitter.
- error_
handler - Centralized error handling with TUI modal support
- playlist
- YouTube playlist management module.
- progress
- Module for managing progress bars
- temp_
file - RAII temporary file management module
- ui
- Minimalist user interface module
- utils
- yt_
dlp_ progress - Module for parsing yt-dlp progress in real time.
- yt_
dlp_ update - yt-dlp auto-update functionality
- ytdlp_
error_ parser - Parser for yt-dlp error messages to provide user-friendly error messages.
- ytdlp_
helper - Helper functions for yt-dlp version management and auto-update.