Metadata-Version: 2.4
Name: ytdwnld
Version: 0.1.0
Summary: Fastest YouTube downloader. Zero dependencies. Pure Python.
Author-email: Parth <nainaonton@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/nainaonton/ytdwnld
Project-URL: Issues, https://github.com/nainaonton/ytdwnld/issues
Keywords: youtube,downloader,video,audio,stream
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Video
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# ytdwnld

**Fastest YouTube downloader. Zero dependencies. Pure Python.**

Faster than yt-dlp. No throttling. 16 parallel connections. No pip dependencies needed.

## Install

```bash
pip install ytdwnld
```

## Usage

### CLI

```bash
# Download best quality (1080p AV1 + audio, merged)
ytdwnld "https://www.youtube.com/watch?v=VIDEO_ID"

# Specific quality
ytdwnld "https://www.youtube.com/watch?v=VIDEO_ID" --quality 720p

# Audio only
ytdwnld "https://www.youtube.com/watch?v=VIDEO_ID" --audio-only

# List available formats
ytdwnld "https://www.youtube.com/watch?v=VIDEO_ID" --list-formats

# Playlist
ytdwnld "https://www.youtube.com/playlist?list=PLAYLIST_ID"

# More connections = faster (default 16)
ytdwnld URL --connections 32
```

### Python API

```python
from ytdwnld import YouTube

# Basic
yt = YouTube("https://www.youtube.com/watch?v=VIDEO_ID")
print(yt.title)
print(yt.author)
yt.download()  # 1080p, full speed

# Audio only
yt.download(audio_only=True)

# Specific quality
yt.download(quality="720p")

# Custom location
yt.download(output_dir="~/Videos", filename="my_video")

# Access streams directly
for stream in yt.streams:
    print(stream)

# Filter streams
best_audio = yt.streams.filter(audio_only=True).order_by("bitrate", reverse=True).first()
yt.download(stream=best_audio)
```

### Playlist

```python
from ytdwnld import Playlist

pl = Playlist("https://www.youtube.com/playlist?list=PLxxxxxxx")
print(f"{pl.count} videos")
pl.download_all(output_dir="./my_playlist")
```

## Why faster than yt-dlp?

| | ytdwnld | yt-dlp |
|---|---|---|
| **Speed** | 5.5 MB/s constant | 3.5 MB/s (stutters) |
| **Time (1080p, 27min video)** | 40s | 61s |
| **Dependencies** | 0 | 20+ |
| **Throttled?** | No | Yes |

**How:** 16 parallel HTTP Range connections bypass YouTube's per-connection throttle. AV1 codec by default (same quality, half the file size). Pure Python stdlib — no `requests`, no `js2py`, nothing.

## Requirements

- Python 3.8+
- ffmpeg (optional, for merging 1080p video+audio — without it you get 360p)

## License

MIT
