A simple Python-based YouTube video and audio downloader that allows you to easily download YouTube videos in MP4 or MP3 format.
- Download YouTube videos in MP4 format
- Extract audio and save as MP3
- Simple command-line interface
- Robust error handling
- Filename sanitization
- Python 3.7+
- pip (Python package manager)
- Clone the repository:
git clone https://github.com/Mwantech/youtube-video-downloader.git
cd youtube-video-downloader
- Create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install required dependencies:
pip install -r requirements.txt
pytube
requests
Run the script and follow the prompts:
python youtubedownloader.py
- When prompted, paste the YouTube video link
- Choose the download format (mp4 or mp3)
Welcome to the YouTube Downloader!
Paste the YouTube video link: https://youtu.be/example-video
Choose format to download (mp4/mp3): mp4
- Ensure you have a stable internet connection
- Verify the video is publicly accessible
- Update pytube to the latest version if issues persist
- Some protected or region-restricted videos may not download
- Requires periodic updates due to YouTube's changing website structure
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
This tool is for personal and educational purposes. Always respect YouTube's terms of service and copyright regulations.
Your Name - mwantech005@gmail.com
Project Link: https://github.com/Mwantech/youtube-video-downloader