Skip to main content

Python Youtube Downloader

A simple command-line application to download YouTube videos as MP3 (audio) or MP4 (video). Optionally saves to an external drive.

Prerequisites

  • Python 3.x
  • yt-dlp: Installed via pip install yt-dlp
  • ffmpeg: Required for audio conversion.
    • macOS: brew install ffmpeg
    • Windows: Download from ffmpeg.org and add to PATH.
    • Linux: sudo apt install ffmpeg

Installation

Option A: pip (Python package)

Install with pip so the youtube-downloader command is available. This also installs yt-dlp for you.

pip install python-youtube-downloader
# or into your user directory (available in any terminal):
pip install --user python-youtube-downloader

Then run:

youtube-downloader

Where pip installs: With pip install, the package goes into your active Python environment (e.g. your conda env or site-packages). With pip install --user, it installs into your user directory so the command is available in any terminal. You still need ffmpeg installed on your system for MP3/MP4 conversion.

Option B: npm (global CLI)

Install globally and run from anywhere (uses Node to run the Python script):

npm install -g python-youtube-downloader

Then use:

youtube-downloader
# or
python-youtube-downloader

If you install with both pip and npm: Both register a youtube-downloader command. Whichever directory comes first in your PATH runs (no crash). Pick one install method if you want to avoid ambiguity.

Option C: From source

  1. Clone or download this repository.
  2. Install the required Python library:
    pip install yt-dlp
    

Prerequisites: Python 3, yt-dlp (installed automatically with pip option), and ffmpeg (for MP3/MP4 conversion).

Usage

Run the script and enter the YouTube URL when prompted. Choose MP3 (audio only) or MP4 (video). If an external drive named SWIM PRO is connected, files are saved there; otherwise they go to the current folder.

python downloader.py
# or, if installed via npm:
youtube-downloader

Or with link and format:

python downloader.py "https://youtu.be/VIDEO_ID" mp3
python downloader.py "https://youtu.be/VIDEO_ID" mp4
youtube-downloader "https://youtu.be/VIDEO_ID" mp4

Release files for python-youtube-downloader 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-youtube-downloader 1.0.0
File Size Uploaded
python_youtube_downloader-1.0.0.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-youtube-downloader 1.0.0
File Interpreter ABI Platform
python_youtube_downloader-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / python_youtube_downloader-1.0.0.tar.gz

Download URL python_youtube_downloader-1.0.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9d80ec7eb0d45c9e19ea55dc5d6245e9b0fa3165db6228820e90828537e7f5f7
BLAKE2b-256 checksum
How to use checksums
6aee993004291ac9649e699be3fe5af883c1e2e293ddf66d9d8a7fe943106ca8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / python_youtube_downloader-1.0.0-py3-none-any.whl

Download URL python_youtube_downloader-1.0.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f7b7539fed7486d9dedb02f71b2ae252b0c85d28b923ff4d20682467aa38988
BLAKE2b-256 checksum
How to use checksums
a0783c08a034ecea3888b88d4dd31d99cf150131ee089f70cf63019abac3033a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page