No description
  • Python 86.5%
  • HTML 11%
  • CSS 1.5%
  • Shell 0.7%
  • Dockerfile 0.3%
Find a file
2025-11-10 00:29:39 +02:00
.github build(workflow): update steps, use semver tags 2022-07-30 00:23:05 -05:00
.vscode update packages, switch to starlette 2020-12-04 02:37:21 -06:00
bin add mpv bin script 2024-07-21 01:51:51 +03:00
commands bangerfm go bye-bye 2025-11-09 17:34:41 +02:00
config Use TTS to announce song names 2023-11-30 11:56:12 +02:00
media delet this 2024-09-20 10:35:21 +03:00
musicbot Bot status hack; use separate yt-dlp web service to get metadata so it doesn't bog down the bot 2025-11-09 17:42:25 +02:00
plugins Use TTS to announce song names 2023-11-30 11:56:12 +02:00
static template updates 2025-11-09 17:46:19 +02:00
templates template updates 2025-11-09 17:46:19 +02:00
.env.template yt-dlp Discord bot 2023-05-05 17:35:23 +03:00
.gitignore Add possibility for radio RDS 2024-08-09 16:24:31 +03:00
bot_tts.py tts to video 2024-07-21 01:45:53 +03:00
bot_tts_fake.py add bot_manage, fake tts bot 2024-07-21 01:44:16 +03:00
db.py Admin users 2023-06-05 20:48:54 +03:00
default_image.png yt-dlp Discord bot 2023-05-05 17:35:23 +03:00
default_video.png yt-dlp Discord bot 2023-05-05 17:35:23 +03:00
discord_api.py Auth tokens and checks 2023-05-13 20:19:41 +03:00
discord_bot.py syntax cleanup 2025-11-09 17:31:44 +02:00
Dockerfile Allow all IPs to proxy, so uvicorn would actually enable https scheme 2023-05-09 17:33:58 +03:00
downloaders.py Move downloaders to downloaders.py; Add /convertmp3 app command 2025-11-09 17:28:24 +02:00
LICENSE Initial commit 2015-02-11 00:51:16 -06:00
localai.py LocalAI: get image from url instead of assuming it is in /tmp already 2023-08-20 13:21:52 +03:00
manage_bot.py Use Starlette middleware for authentication 2024-08-19 23:07:38 +03:00
README.md feat(server): switch from youtube-dl to yt-dlp 2022-07-30 00:00:49 -05:00
requirements.txt requirements.txt update 2025-11-09 18:01:18 +02:00
run.sh use venv 2023-08-20 13:21:52 +03:00
SECURITY.md Create SECURITY.md 2023-03-19 20:06:45 -05:00
simple_ytdl.py Add simple_ytdl.py 2025-11-02 23:28:04 +02:00
simple_ytdl.service Add simple_ytdl.py 2025-11-02 23:28:04 +02:00
thumbnailer.py thumbnailer.py: import clean up 2025-11-10 00:29:39 +02:00
tiktok.py tiktok: misc 2024-07-21 01:49:58 +03:00
util.py shorter link hash 2025-11-09 17:46:46 +02:00
ydl.service yt-dlp Discord bot 2023-05-05 17:35:23 +03:00
youtube-dl-server.png docs(readme): update screenshot 2018-12-05 03:04:48 -06:00
youtube-dl-server.py Don't add "?url..." to oembed_json_url 2025-11-09 18:00:17 +02:00

Docker Stars Shield Docker Pulls Shield GitHub license Workflow

youtube-dl-server

Very spartan Web and REST interface for downloading youtube videos onto a server. starlette + yt-dlp.

screenshot

Running

Docker CLI

This example uses the docker run command to create the container to run the app. Here we also use host networking for simplicity. Also note the -v argument. This directory will be used to output the resulting videos

docker run -d --net="host" --name youtube-dl -v /home/core/youtube-dl:/youtube-dl kmb32123/youtube-dl-server

Docker Compose

This is an example service definition that could be put in docker-compose.yml. This service uses a VPN client container for its networking.

  youtube-dl:
    image: "kmb32123/youtube-dl-server"
    network_mode: "service:vpn"
    volumes:
      - /home/core/youtube-dl:/youtube-dl
    restart: always

Python

If you have python ^3.6.0 installed in your PATH you can simply run like this, providing optional environment variable overrides inline.

YDL_UPDATE_TIME=False python3 -m uvicorn youtube-dl-server:app --port 8123

In this example, YDL_UPDATE_TIME=False is the same as the command line option --no-mtime.

Usage

Start a download remotely

Downloads can be triggered by supplying the {{url}} of the requested video through the Web UI or through the REST interface via curl, etc.

HTML

Just navigate to http://{{host}}:8080/youtube-dl and enter the requested {{url}}.

Curl

curl -X POST --data-urlencode "url={{url}}" http://{{host}}:8080/youtube-dl/q

Fetch

fetch(`http://${host}:8080/youtube-dl/q`, {
  method: "POST",
  body: new URLSearchParams({
    url: url,
    format: "bestvideo"
  }),
});

Bookmarklet

Add the following bookmarklet to your bookmark bar so you can conviently send the current page url to your youtube-dl-server instance.

javascript:!function(){fetch("http://${host}:8080/youtube-dl/q",{body:new URLSearchParams({url:window.location.href,format:"bestvideo"}),method:"POST"})}();

Implementation

The server uses starlette for the web framework and youtube-dl to handle the downloading. The integration with youtube-dl makes use of their python api.

This docker image is based on python:alpine and consequently alpine:3.8.