# YouTube Downloader
A simple Python script to download videos or audio from YouTube. The program uses the `pytubefix` library to fetch video or audio streams and allows the user to choose between downloading either a video or an audio file. The audio files are automatically converted from MP4 to MP3 format using the `pydub` library.- Download YouTube videos in different resolutions.
- Download YouTube audio and convert it to MP3 format.
- Clean up original downloaded audio files after conversion.
-
Clone the repository:
git clone https://github.com/yourusername/youtube-downloader.git cd youtube-downloader -
Install required dependencies: Make sure you have Python installed. Then, install the necessary libraries:
pip install pytubefix pip install pydub
-
Install
ffmpeg: Thepydublibrary requiresffmpegto be installed on your system. Download and install it from ffmpeg.org.
-
Run the script: Execute the Python script:
python downloader.py
-
Input the YouTube link: Paste the YouTube link when prompted.
-
Choose the download option:
- Enter
1for video download. - Enter
2for audio download.
- Enter
-
Select desired quality:
- For video, select the desired resolution.
- For audio, choose the desired bitrate.
-
Follow on-screen instructions:
- Provide a custom filename for the audio download.
- The audio will be converted to MP3, and the original file will be removed after conversion.
- pytubefix: Python library for downloading YouTube videos.
- pydub: Python library for manipulating audio.
- ffmpeg: A complete, cross-platform solution to record, convert and stream audio and video.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.