youtubedlapi-server-infusiblecoder
A REST API server for video info, downloads, and streaming — powered by yt-dlp (nightly).
Requires Python >= 3.11. Uses uv for package management. The Docker image includes Deno + FFmpeg for JavaScript extractors and video merging.
Installation
pip install youtubedlapi-server-infusiblecoder
Or from source:
git clone https://github.com/syedusama5556/youtubedlapi-server-infusiblecoder
cd youtubedlapi-server-infusiblecoder
pip install uv
uv sync
Docker
docker build -t youtubedlapi .
docker run -p 9191:9191 youtubedlapi
Usage
uvicorn youtubedlapi_server_infusiblecoder.app:app --host 0.0.0.0 --port 9191
Or via the CLI:
youtubedlapi-server-infusiblecoder --host 0.0.0.0 --port 9191
Dependencies
The server auto-detects these at startup:
| Dep | Required for |
|---|---|
| curl-cffi | Browser impersonation (TLS fingerprint bypass) — enables Dailymotion |
| yt-dlp-ejs + Deno/Node | Full YouTube extractor support |
| FFmpeg | Merging bestvideo+bestaudio, post-processing |
| brotli | Brotli content encoding support |
| websockets | WebSocket-based downloads |
| pycryptodomex | AES-128 HLS stream decryption |
| mutagen | Thumbnail embedding |
Install any missing deps with:
pip install curl-cffi yt-dlp-ejs brotli websockets pycryptodomex mutagen
API Endpoints
All responses are JSON unless noted.
Info
| Endpoint | Description |
|---|---|
GET /api/info?url=<url>&flatten=true |
Full video/playlist info from yt-dlp |
GET /api/formats?url=<url> |
All available formats (resolution, codec, bitrate, filesize) |
GET /api/subtitles?url=<url> |
Available subtitle languages |
GET /api/search?q=<query>&limit=10 |
Search videos on supported sites |
Download & Stream
| Endpoint | Description |
|---|---|
GET /api/download?url=<url>&format_id=best |
Download a video, returns a temp streaming link (auto-expires 1h, 500MB cap, auto-merges video+audio with ffmpeg) |
GET /api/stream/<file_id> |
Stream the downloaded file (supports range requests for seeking) |
GET /api/stream/<file_id>?download=1 |
Force-download the file with original filename |
GET /api/audio?url=<url> |
Get best audio-only stream URL |
GET /api/play?url=<url> |
Redirect to the video's direct stream URL |
Server
| Endpoint | Description |
|---|---|
GET /api/extractors |
List all supported sites/extractors |
GET /api/version |
yt-dlp & server versions |
GET /api/status |
Check installed deps (ffmpeg, deno, node, js_runtimes) |
GET /api/bili?url=<bilibili-url> |
Bilibili video info (via bilix) |
Example: Download & Stream Flow
# 1. Download a video
curl "http://localhost:9191/api/download?url=https://youtube.com/watch?v=..."
# → { "file_id": "abc123", "stream_url": "/api/stream/abc123", ... }
# 2. Stream it (open in browser or player)
curl "http://localhost:9191/api/stream/abc123" -o video.mp4
# 3. Or embed in a video tag / VLC
# vlc http://localhost:9191/api/stream/abc123
Sample Usage (Tested URLs)
All tested with the latest nightly yt-dlp.
# YouTube — info, formats, subtitles, audio, search
curl "http://localhost:9191/api/info?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ&flatten=true"
curl "http://localhost:9191/api/formats?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ"
curl "http://localhost:9191/api/subtitles?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ"
curl "http://localhost:9191/api/audio?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ"
curl "http://localhost:9191/api/search?q=never+gonna+give+you+up&limit=3"
# Vimeo
curl "http://localhost:9191/api/info?url=https://vimeo.com/76979871&flatten=true"
# TED
curl "http://localhost:9191/api/info?url=https://www.ted.com/talks/chloe_valdary_how_love_can_help_repair_social_inequality&flatten=true"
# Dailymotion (requires curl-cffi)
curl "http://localhost:9191/api/info?url=https://www.dailymotion.com/video/xal2ebm&flatten=true"
# Bilibili
curl "http://localhost:9191/api/bili?url=https://www.bilibili.com/video/BV1GJ411x7"
Handling Failed Sites
These are known limitations — no server-side fix possible:
| Site | Issue |
|---|---|
| Spotify | DRM protected, not supported by yt-dlp |
| Instagram (image posts) | No video available |
| TikTok (blocked regions) | IP blocked from accessing the post |
| API parse error — needs yt-dlp extractor update |
Project Structure
src/
└── youtubedlapi_server_infusiblecoder/ # Python package
├── app.py # FastAPI app with all endpoints
├── server.py # CLI entry point
├── __init__.py
├── __main__.py
└── version.py
deploy/ # Docker, K8s, GAE, Heroku configs
docs/ # Sphinx documentation
devscripts/ # Build & publish scripts
test/ # Tests
Development
uv sync --group dev
uv run pytest
License
Released to the public domain.
Metadata
Release files for youtubedlapi-server-infusiblecoder 3.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| youtubedlapi_server_infusiblecoder-3.10.0.tar.gz | 20.1 kB | Without provenance | Details for youtubedlapi_server_infusiblecoder-3.10.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| youtubedlapi_server_infusiblecoder-3.10.0-py3-none-any.whl | Python 3 | none | any | Details for youtubedlapi_server_infusiblecoder-3.10.0-py3-none-any.whl |
Total release size: 31.4 kB
Release files / youtubedlapi_server_infusiblecoder-3.10.0.tar.gz
| Download URL | youtubedlapi_server_infusiblecoder-3.10.0.tar.gz |
|---|---|
| Size | 20.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0cc62e49aefed54eab98247278c0b46a8e6dc63e45efa245fc0bb181e969f4e4
|
|
BLAKE2b-256 checksum How to use checksums |
1a3b9c995135032eedd28a076fc779781b20f6003cfa4db4aaa6668391e58613
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / youtubedlapi_server_infusiblecoder-3.10.0-py3-none-any.whl
| Download URL | youtubedlapi_server_infusiblecoder-3.10.0-py3-none-any.whl |
|---|---|
| Size | 11.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8700e46b3943ca5536dfc3cd2d234c1176489f1395106cf54deab2539fbe2837
|
|
BLAKE2b-256 checksum How to use checksums |
f477ea553d943fe1cf29d34ca4c64a914488a2d550482c0cc796d1cdfa97a466
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Security for youtubedlapi-server-infusiblecoder 3.10.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.