1 stable release
new 1.0.51 | Feb 27, 2025 |
---|
#46 in Multimedia
38KB
599 lines
Auto-YTDLP
Overview
I wrote this script originally in Python so that I didn't have to manually archive a massive list of YouTube university course videos (at the request of my professor). I built it around the yt-dlp repository because it extends the capabilities of manual downloads by incorporating a lot of QoL features. This script builds on top of that by adding multiple download multithreading and an intuitive TUI.
However I rewrote it in Rust, as a little practice for myself, since I've been trying to write more Rust recently.
It's not just for archiving course videos however! This script can handle all sorts of video-downloading tasks. Maybe you're a researcher collecting data, a content creator gathering inspiration, or just someone who likes to keep offline copies of their favorite online content. Whatever your reason, I hope my little repo helps.
Here's what makes this script nice to have:
- Multi-video Downloading: Downloads multiple videos concurrently, making efficient use of your bandwidth and saving time.
- Clean Interface: The TUI shows you exactly what's happening - active downloads, queue status, and detailed logs all in one view.
- Easy to Use: Simple keyboard controls let you manage downloads, pause/resume operations, and add new URLs without hassle.
- Flexible: Configure concurrent download limits, download directories, and archive locations to suit your needs.
- Hard Shell: Built in Rust for rock-solid stability. Handles long download sessions reliably and shuts down gracefully when needed.
- Organized: Keeps track of downloaded videos and maintains clean logs, so you always know what's happening.
And hey, if you think of some cool feature to add, the code's right there for you to tinker with!
Features
- Download videos from URLs listed in a text file
- Terminal User Interface (TUI)
- Multithreaded downloads for improved performance
- yt-dlp archive feature to avoid re-downloading
- Verbose logging
- Parallel processing limit
- Desktop notification system
- Graceful shutdown
- Metadata extraction (using yt-dlp's built-in functionality)
- Clipboard integration for easy URL addition
- Progress tracking with visual feedback
Requirements
- Rust (latest stable version)
- yt-dlp
- ffmpeg (yt-dlp requires it as an internal dependency)
- Additional dependencies will be handled by Cargo
Installation
Using Pre-built Binaries
-
Go to the Releases page
-
Download the appropriate binary for your system:
- Windows:
auto-ytdlp-[version]-windows.exe
- macOS:
auto-ytdlp-[version]-macos
- Linux:
auto-ytdlp-[version]-linux
- Windows:
-
Make the binary executable (macOS/Linux only):
chmod +x auto-ytdlp-[version]-[platform]
-
Optional: Move the binary to a directory in your
PATH
:- Windows: Move to
C:\Windows\
or add the binary location to yourPATH
- macOS/Linux:
sudo mv auto-ytdlp-[version]-[platform] /usr/local/bin/auto-ytdlp
- Windows: Move to
Installation via Cargo
# Install directly from crates.io
cargo install auto-ytdlp-rs
# Then run with:
auto-ytdlp
Building from source
-
Clone this repository:
git clone https://github.com/panchi64/auto-ytdlp.git cd auto-ytdlp
-
Build the project:
cargo build --release
-
Run the application:
cargo run --release
[!WARNING] You need FFMPEG and yt-dlp installed in your system for the script to work appropriately.
Usage
The application can be run in two modes:
[!NOTE] The following commands assume you've renamed the downloaded binary file from:
auto-ytdlp-[version]-[platform]
toauto-ytdlp
TUI Mode (Default):
# Using pre-built binary
./auto-ytdlp
# If you wanna download the videos into the folder you're in, use:
./auto-ytdlp -d ./
# Or if installed to PATH
auto-ytdlp
Interface Controls
S
: Start/Stop downloadsP
: Pause active downloadsR
: Refresh downloads from links list fileA
: Add URLs from clipboardQ
: Graceful shutdownShift+Q
: Force quit
[!NOTE] All quit options will wait for the currently active downloads to finish, even the Force Quit
Automated Mode (no TUI):
# Using pre-built binary:
./auto-ytdlp --auto
# Or if installed to PATH
auto-ytdlp --auto
Command Line options
-a, --auto Run in automated mode without TUI
-c, --concurrent <CONCURRENT> Max concurrent downloads [default: 4]
-d, --download-dir <DOWNLOAD_DIR> Download directory [default: ./yt_dlp_downloads]
-f, --archive-file <ARCHIVE_FILE> Archive file path [default: ./download_archive.txt]
-h, --help Print help
-V, --version Print version
File Management
The application handles several important files:
links.txt
: Contains your download queuedownload_archive.txt
: Tracks completed downloads- Download directory: Where your content gets saved
Troubleshooting
- Ensure yt-dlp is properly installed and in your
PATH
- Check the logs panel for detailed error messages
- Verify your URLs are valid and accessible
- Make sure you have write permissions in the download directory
If you get the "auto-ytdlp-[version]-macos not opened" message on Apple devices. Use the following command to remove it from quarantine:
xattr -dr com.apple.quarantine <path to file>/auto-ytdlp-[version]-macos
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the GNU GPLv3 - look at the LICENSE file for details.
Disclaimer
This tool is for educational purposes only. Please make sure you have the right to download any content before using this script. I'm not responsible for any misuse of this software.
Dependencies
~8–36MB
~542K SLoC