Metadata-Version: 2.4
Name: python-youtube-downloader
Version: 1.0.0
Summary: Download YouTube videos as MP3 or MP4 from the command line
License: MIT
Project-URL: Repository, https://github.com/SyntheticVis-Umut/Python-Youtube-Downloader
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: yt-dlp>=2024.1.0
Provides-Extra: dev
Dynamic: license-file

# 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](https://ffmpeg.org/download.html) 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.

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

Then run:

```bash
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):

```bash
npm install -g python-youtube-downloader
```

Then use:

```bash
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:
   ```bash
   pip install yt-dlp
   ```

**Prerequisites:** Python 3, [yt-dlp](https://github.com/yt-dlp/yt-dlp) (installed automatically with pip option), and [ffmpeg](https://ffmpeg.org/) (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.

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

Or with link and format:

```bash
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
```
