Skip to content

Latest commit

 

History

History
149 lines (101 loc) · 3.15 KB

File metadata and controls

149 lines (101 loc) · 3.15 KB

▶️ YouTube Downloader

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.


🚀 Features

  • 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)

🛠️ Technologies Used

  • python 3
  • tkinter (Python’s built-in GUI library)
  • python-dotenv
  • yt-dlp (downloads and retrieves video data from YouTube)

📂 Project Structure

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

demo


⚙️ Installation

  1. Clone the repository
git clone https://github.com/Mojtaba-Shafidokht/youtube-downloader.git
cd youtube-downloader
  1. Create and activate virtual environment:

Windows:

python -m venv .venv
.\.venv\Scripts\activate

Linux / macOS:

python3 -m venv .venv
source .venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt

🧾 Configuration

  1. Rename .env.example to .env:

Windows:

Rename-Item .env.example .env

Linux / macOS:

mv .env.example .env
  1. 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 if youtube.com is blocked in your region, otherwise you can use a VPN.

⚠️ Note: If youtube.com isn't blocked in your region, just leave YT_PROXY empty.


▶️ Usage

Run the program:

python main.py

🧠 How It Works

  1. The user enters a YouTube link and clicks Submit
  2. A folder selection dialog opens for choosing the download location
  3. The app attempts to download the video via yt-dlp
  4. During download, progress is shown (progress bar, percentage, speed, ETA)
  5. The best available video quality is automatically selected
  6. If an error occurs, it's displayed and the app resets, ready for another attempt

⚠️ Notes

  • 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

🔮 Future Improvements

  • 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

👨‍💻 Author

Mojtaba Shafidokht


⭐️ Show your support

If you find this project useful, consider giving it a star ⭐ on GitHub!