A simple desktop GUI application that downloads YouTube videos. The user provides a video link, selects a destination folder, and the app handles the rest.
- Downloads a video from a user-provided YouTube link (the best quality)
- Lets the user choose where to save the file
- Shows live download progress (percentage, speed, ETA)
- python 3
- tkinter (Python’s built-in GUI library)
- python-dotenv
- yt-dlp (downloads and retrieves video data from YouTube)
youtube-downloader/
│
├── main.py # Entry point of the application
├── gui.py # Tkinter interface and app logic
├── downloader.py # Handles video downloading via yt-dlp
├── assets/
│ └── demo.gif # Demo GIF shown in README
├── .env.example # Template for environment variables
├── requirements.txt # Project dependencies
└── README.md # Project documentation
- Clone the repository
git clone https://github.com/Mojtaba-Shafidokht/youtube-downloader.git
cd youtube-downloader- Create and activate virtual environment:
Windows:
python -m venv .venv
.\.venv\Scripts\activateLinux / macOS:
python3 -m venv .venv
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Rename
.env.exampleto.env:
Windows:
Rename-Item .env.example .envLinux / macOS:
mv .env.example .env- Open .env and fill in your proxy (only in blocked regions like Iran):
YT_PROXY=http://127.0.0.1:10808
⚠️ Note: Local proxy URL (e.g.http://127.0.0.1:10808) — only needed ifyoutube.comis blocked in your region, otherwise you can use a VPN.
⚠️ Note: If youtube.com isn't blocked in your region, just leaveYT_PROXYempty.
Run the program:
python main.py- The user enters a YouTube link and clicks Submit
- A folder selection dialog opens for choosing the download location
- The app attempts to download the video via yt-dlp
- During download, progress is shown (progress bar, percentage, speed, ETA)
- The best available video quality is automatically selected
- If an error occurs, it's displayed and the app resets, ready for another attempt
- This project is for educational purposes
- For now this application only works with YouTube
- As mentioned above, 'youtube.com' may be blocked in some regions (e.g. Iran). In that case, use a Proxy or a VPN
- Let the user select video quality and format (e.g., MP4, MP3-only audio)
- Add support for downloading playlists
- Add support for other platforms (e.g., TikTok, Instagram)
- Show a download history or list of completed downloads
Mojtaba Shafidokht
If you find this project useful, consider giving it a star ⭐ on GitHub!
