This document provides in-depth technical information regarding the architecture and workflow of VideoCut-CLI.
The project follows a modular pattern separating the interface (CLI), orchestration (Core), and specific functionality (Modules).
- CLI Layer (
cli.py): UsesTyperto handle command-line arguments and user interaction. - Orchestrator (
cli.py): Currently orchestrates thedownload,edit, anddoctorcommands. - Modules (
/modules/):downloader.py: Wrapper foryt-dlp. Uses a prioritized list of player clients (android,web_embedded, etc.) to bypass YouTube SABR 403 errors.editor.py: Handles FFmpeg pipelines usingimageio-ffmpegas a fallback.
Files are stored in {platform}/{video_id}/ relative to the download directory.
~/Downloads/youtube/{video_id}/
├── {slug}_{id}_{res}.mp4 (Raw Video)
├── {slug}_{id}_{res}.jpg (Thumbnail)
├── {slug}_{id}_{res}.json (Raw yt-dlp metadata)
├── {slug}_{id}_{res}.vtt (Subtitles/Captions)
└── metadata_{id}.md (Cleaned Markdown Metadata)
- FFmpeg: Checks for system
ffmpegfirst, then falls back toimageio-ffmpegbinary. - Bypassing 403s: Uses
androidplayer client inyt-dlpextractor arguments as it is currently the most stable for bypassing signature/SABR restrictions. - JS Runtime: Requires
nodeordenoforyt-dlpto handle YouTube's signature decryption. - Smart Skip: Always verify if a file ID suffix exists before initiating a new download stream.
Planned for /presets/*.yaml. The reels and shorts presets will define aspect_ratio and caption_style.