Skip to content

Nxzume/python-youtube-downloader

Repository files navigation

YouTube Video Downloader 🎬

A simple, modern desktop application to download YouTube videos and convert them to MP3 audio files. No technical knowledge required!

✨ What Can This Do?

  • Download YouTube Videos - Save any YouTube video to your computer
  • Convert to MP3 - Extract audio from videos and save as MP3 files
  • Choose Quality - Select video quality (1080p, 720p, 480p, etc.)
  • Easy to Use - Beautiful graphical interface - just paste a link and click download!
  • Works Offline - Once downloaded, watch/listen without internet
  • Dark Mode - Switch between light and dark themes

🚀 Quick Start (Easiest Way)

For Most Users: Use the Pre-Built Executable

If you just want to download videos without any setup:

  1. Download the latest release (look for YouTube Downloader.exe)
  2. Double-click the .exe file to run it
  3. That's it! No installation needed - just paste a YouTube URL and click download

💡 Note: If you don't have a pre-built executable yet, see "Building Your Own Executable" below.

📋 Step-by-Step Guide for First-Time Users

Step 1: Choose Your Method

Option A: Use Pre-Built Executable (Easiest)

  • Download YouTube Downloader.exe from the releases
  • Double-click to run - no setup needed!

Option B: Build Your Own Executable

  • Follow the "Building Your Own Executable" section below
  • Takes 5-10 minutes, but you'll have your own copy

Option C: Run from Source (For Developers)

  • Requires Python installed
  • See "Running from Source" section below

Step 2: Using the Application

  1. Open the application (double-click the .exe file)

  2. Paste a YouTube URL

    • Go to YouTube and copy the video URL
    • Paste it into the "YouTube URL" box
  3. Choose what to download:

    • 📹 Video - Download the full video file
    • 🎵 Audio (MP3) - Extract just the audio as an MP3 file
  4. Select quality (for videos only):

    • Best - Highest available quality (recommended)
    • 1080p, 720p, 480p, etc. - Specific quality
    • Worst - Smallest file size
  5. Choose where to save:

    • Click "Browse" to pick a folder
    • Or leave it as default (saves to downloads folder)
  6. Enable browser cookies (recommended):

    • ✅ Keep "Use browser cookies" checked
    • Select your browser (Chrome, Firefox, Edge, etc.)
    • This helps bypass YouTube's bot detection
  7. Click "⬇️ Download"

    • Watch the progress bar
    • See status updates in the log area
    • Your file will be saved when complete!

🎨 Features Explained

Modern Interface

  • Clean Design - Easy to understand, no clutter
  • Dark Mode - Click the moon/sun icon (top-right) to switch themes
  • Real-time Progress - See exactly what's happening during download

Browser Cookies (Important!)

  • What it does: Uses your browser's login cookies to access YouTube
  • Why you need it: YouTube sometimes blocks downloads - cookies make it work!
  • How to use:
    • Make sure you're logged into YouTube in your browser
    • Select your browser from the dropdown
    • Keep the checkbox checked (it's on by default)

Download Options

  • Video Quality: Choose from best quality down to 240p
  • Audio Only: Extract audio and convert to MP3 (192kbps)
  • Playlists: Automatically detects and downloads entire playlists

🛠️ Building Your Own Executable

If you want to build the application yourself (takes about 5-10 minutes):

Prerequisites

  • Windows 10 or 11
  • Python 3.7 or newer (Download here)
    • When installing Python, check "Add Python to PATH"

Step-by-Step Build Instructions

  1. Download this project

    • Click the green "Code" button → "Download ZIP"
    • Extract the ZIP file to a folder
  2. Open Command Prompt or PowerShell

    • Press Windows Key + R
    • Type cmd and press Enter
    • Navigate to the project folder:
      cd "C:\path\to\Youtube downloader"
      (Replace with your actual folder path)
  3. Install build tools

    pip install -r requirements_build.txt

    This installs PyInstaller and yt-dlp

  4. Build the executable

    • Simple method: Double-click build_exe.bat
    • Or manually: Run the command in the "Manual Build" section below
  5. Find your executable

    • Look in the dist folder
    • You'll find YouTube Downloader.exe
    • This file can be moved anywhere and run on any Windows PC!

Build Options

Simple Build (Recommended for beginners):

  • Double-click build_exe.bat
  • Creates: dist\YouTube Downloader.exe (~25-35 MB)
  • Includes everything needed

Optimized Build (Smaller file):

  • Double-click build_exe_advanced.bat
  • Creates: dist\YouTube Downloader.exe (~20-30 MB)
  • Same features, smaller size

Manual Build:

pip install pyinstaller
pyinstaller --onefile --windowed --name "YouTube Downloader" --add-data "ffmpeg_bin;ffmpeg_bin" youtube_downloader_gui.py

💡 Note: FFmpeg is automatically downloaded during the build process. This enables MP3 audio downloads without any extra setup!

💻 Running from Source (For Developers)

If you have Python installed and want to run the code directly:

  1. Install Python dependencies:

    pip install -r requirements.txt
  2. Run the application:

    python youtube_downloader_gui.py
  3. For audio downloads, install FFmpeg:

❓ Frequently Asked Questions

"I get an error about cookies or bot detection"

  • ✅ Make sure "Use browser cookies" is checked
  • ✅ Select the browser you use for YouTube (Chrome, Firefox, Edge, etc.)
  • ✅ Make sure you're logged into YouTube in that browser
  • ✅ Try closing and reopening the application

"Audio downloads don't work"

  • If using the executable: FFmpeg should be included automatically
  • If running from source: Install FFmpeg (see "Running from Source" above)
  • Check the log area for specific error messages

"The download is slow"

  • This is normal! Download speed depends on:
    • Your internet connection
    • Video quality (higher quality = larger files = longer download)
    • YouTube's servers

"Where are my downloads saved?"

  • Default location: downloads folder in the same directory as the application
  • You can change this by clicking "Browse" and selecting a different folder

"Can I download playlists?"

  • Yes! Just paste a playlist URL instead of a single video URL
  • The app will automatically detect it's a playlist and download all videos

"What video formats are supported?"

  • The app downloads videos in their original format (usually MP4)
  • Audio is converted to MP3 format

"Can I use this on Mac or Linux?"

  • Currently designed for Windows
  • Mac/Linux users can run from source (see "Running from Source" section)
  • Building executables for Mac/Linux requires different tools

📁 File Locations

  • Downloads: Saved to downloads folder by default (in the same folder as the app)
  • Executable: dist\YouTube Downloader.exe (after building)
  • Source Code: youtube_downloader_gui.py

🎯 Tips for Best Results

  1. Use Browser Cookies - Always keep this enabled to avoid errors
  2. Stay Logged In - Make sure you're logged into YouTube in your browser
  3. Choose Quality Wisely - Higher quality = larger files
  4. Check Your Internet - Downloads require a stable connection
  5. Be Patient - Large videos or playlists take time

🔧 Troubleshooting

Application won't start

  • Make sure you have Windows 10 or 11
  • Try running as administrator (right-click → Run as administrator)
  • Check if your antivirus is blocking it

Downloads fail

  • Check your internet connection
  • Make sure the YouTube URL is valid
  • Enable browser cookies (see FAQ above)
  • Try a different video to see if it's video-specific

Build fails

  • Make sure Python is installed and added to PATH
  • Try running: pip install --upgrade pip
  • Make sure you have enough disk space (builds require ~500MB temporarily)

📝 Requirements Summary

For End Users (Using Executable):

  • ✅ Windows 10 or 11
  • ✅ Nothing else! Everything is included

For Building:

  • ✅ Windows 10 or 11
  • ✅ Python 3.7 or newer
  • ✅ Internet connection (to download dependencies and FFmpeg)

For Running from Source:

  • ✅ Python 3.7 or newer
  • ✅ yt-dlp library (installed via pip install -r requirements.txt)
  • ✅ FFmpeg (optional, for audio - can be downloaded automatically)

📄 License

This project uses yt-dlp which is licensed under the Unlicense. See the yt-dlp repository for details.

🙏 Credits

  • Built with yt-dlp - the best YouTube downloader
  • Uses FFmpeg for audio conversion
  • GUI built with Python's Tkinter

💬 Need Help?

  1. Check the FAQ section above
  2. Look at the error messages in the log area
  3. Make sure you're using the latest version
  4. Check that your browser cookies are enabled

Enjoy downloading! 🎉

About

Local youtube video/audio downloader using python

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors