Metadata-Version: 2.4
Name: ytdlm
Version: 1.0.0
Summary: Python SDK for ytdlm — Real-Time SABR UMP WebM/Opus Audio Streamer for Discord Bots
Author-email: ytdlm <341343882+ytdlm@users.noreply.github.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/ytdlm/ytdlm
Project-URL: Repository, https://github.com/ytdlm/ytdlm.git
Project-URL: Issues, https://github.com/ytdlm/ytdlm/issues
Keywords: audio,streaming,opus,webm,ump,sabr,discord,music-bot
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Sound/Audio
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# ytdlm (Python SDK)

Python SDK and `discord.py` voice helper for **[ytdlm](https://github.com/ytdlm/ytdlm)** — a Real-Time SABR UMP WebM/Opus (`251` / `774`) Audio Streaming & Seekable Downloading Engine.

## Installation

```bash
pip install ytdlm
```

*(Requires the `ytdlm` Node.js CLI or HTTP Gateway: `npm install -g ytdlm`)*

## Quick Start

```python
from ytdlm import YtdlmClient

client = YtdlmClient(gateway_url="http://127.0.0.1:8787")

# 1. Resolve track metadata
info = client.info("aqz-KE-bpKQ")
print(info.title, info.duration_sec)

# 2. Build direct HTTP stream URL for FFmpegOpusAudio (with instant seek & loop)
stream_url = client.get_stream_url("aqz-KE-bpKQ", start_sec=30, loop=True)
```

### `discord.py` Bot Integration

```python
import discord
from ytdlm import YtdlmClient

ytdlm = YtdlmClient("http://127.0.0.1:8787")
source = await discord.FFmpegOpusAudio.from_probe(
    ytdlm.get_stream_url("aqz-KE-bpKQ", start_sec=0)
)
voice_client.play(source)
```

## License

[MIT License](https://github.com/ytdlm/ytdlm/blob/main/LICENSE) — See also [Legal Disclaimer](https://github.com/ytdlm/ytdlm/blob/main/DISCLAIMER.md).
