This command-line application downloads YouTube videos specified by the user. It uses the pytube
library to fetch and download the videos.
- Downloads YouTube videos in mp4 format
- Allows downloading multiple videos in one go
- Robust error handling for invalid URLs and unavailable videos
- Clone the repository:
git clone https://github.com/lakota-camp/yt-downloader.git
cd yt-downloader
- Set up a virtual environment and activate it:
python3 -m venv .venv
source .venv/bin/activate # On Windows, use `.venv\Scripts\activate`
- Install the dependencies:
pip install -r requirements.txt
- Run the application:
python3 app.py
🛠️ CLI Command Alias Setup To simplify running the YouTube video downloader, you can set up command aliases in your shell configuration file (.bashrc, .zshrc, etc.):
- Open your shell configuration file:
nano ~/.zshrc # or ~/.bashrc depending on your shell
- Add the following alias definitions:
alias yt-dl='source /path/to/dir/yt-downloader/.venv/bin/activate && python3 /path/to/dir/yt-downloader/app.py'
- Apply the changes:
source ~/.bashrc # or ~/.zshrc depending on your shell
Download videos:
-
Run the command alias to start the application:
yt-dl
-
Follow the prompts:
-
Enter the number of videos to download:
Enter the number of videos to download: 3
-
Enter the URLs for each video one by one:
Enter YouTube URL 1: https://www.youtube.com/watch?v=example_video_id1 Enter YouTube URL 2: https://www.youtube.com/watch?v=example_video_id2 Enter YouTube URL 3: https://www.youtube.com/watch?v=example_video_id3
-
-
The application will then download the specified videos.
- Add a function to download a playlist of videos
- Add a progress bar to show detailed download progress
This project is licensed under the MIT License.