selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitHub
ydl_api_ng logo

Self-host ydl_api_ng

REST API server for yt-dlp video and audio downloads

BetaOpen SourceGPL-3.0
Updated5 months ago
LanguagePython
Setup difficultyModerate
Stars
240
Port
80 (HTTP API)
Requires
Ffmpeg, Python 3, Yt-dlp
Docker
totonyus/ydl_api_ng
Install with Docker Compose
ydl_api_ng screenshot 1

What is ydl_api_ng?

ydl_api_ng is a self-hosted web server that exposes a REST API for yt-dlp, the popular command-line video downloader. It supports downloading from any site yt-dlp supports, with features like multiple download queues, scheduled recordings (programmation), customizable hooks for post-processing, and a userscript for one-click downloads from the browser. It runs via Docker Compose (recommended) or as a systemd service on bare metal, and uses Redis for queue management and scheduling. The API accepts GET and POST requests with presets for common formats (audio, HD, SD, etc.) and allows full yt-dlp parameter customization.

Should you self-host ydl_api_ng?

ydl_api_ng scores 46/100 on selfhost.directory (how scoring works) and ranks #33 of 45 in Download Management. It has 240 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is GPL-3.0-licensed and written mostly in Python.

Its closest alternative on selfhost.directory is cobalt (83/100, 45 584 stars). It scores higher overall, so compare the two before you pick. See ydl_api_ng vs cobalt side by side.

Features

  • Batch Downloads
  • Browser userscript
  • Cookie Management
  • Custom Hooks
  • iOS shortcut
  • Preset system
  • Queue Management
  • REST API
  • Scheduled downloads (programmation)Requires Redis
  • Token-based authenticationDisabled by default in Docker config

ydl_api_ng README

How to install ydl_api_ng

Install ydl_api_ng with Docker Compose

Docker and Docker Compose
Environment variables
UID, GID, NB_WORKERS, LOG_LEVEL, DISABLE_REDIS, FORCE_YTDLP_VERSION

docker compose pull # pull the latest image docker compose up # to start the container docker compose stop # to start the container docker compose down # to destroy the container

Recommended installation method. Includes Redis for queue management.

How to configure ydl_api_ng

  • _allow_dangerous_post_requestsfalseAllow POST requests that can write anywhere on the system

    Allow POST requests that can write anywhere on the system

    values: true, false

  • _enable_redistrueEnable Redis for queue management and scheduling

    Enable Redis for queue management and scheduling

    values: true, false

  • _enable_users_managementfalseEnable token-based user management

    Enable token-based user management

    values: true, false

  • FORCE_YTDLP_VERSIONForce a specific yt-dlp version (environment variable)

    Force a specific yt-dlp version (environment variable)

  • GID1000Group ID for container (environment variable)

    Group ID for container (environment variable)

  • _listen_ip0.0.0.0IP address to bind to

    IP address to bind to

  • _listen_port80Port the API listens on

    Port the API listens on

  • _log_level20Log level (0=NOTSET, 10=DEBUG, 20=INFO, 30=WARNING, 40=ERROR, 50=CRITICAL)

    Log level (0=NOTSET, 10=DEBUG, 20=INFO, 30=WARNING, 40=ERROR, 50=CRITICAL)

  • _programmation_interval60Interval in seconds for the scheduling daemon

    Interval in seconds for the scheduling daemon

  • _redis_hostydl_api_ng_redisRedis host

    Redis host

  • _redis_port6379Redis port

    Redis port

  • UID1000User ID for container (environment variable)

    User ID for container (environment variable)

More in Download Management

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…