Sign inSign up

wiserain/youtube-dl-server

By wiserain

Updated over 5 years ago

Web/REST interface for downloading youtube videos onto a server.

Image
7

100K+

wiserain/youtube-dl-server repository overview

youtube-dl-server

This docker image is with

  • lsiobase/alpine:latest
    • permission handling with PUID and PGID
    • running an app with non-root user
  • Flask web framework
  • Simple REST API for youtube-dl to download requested url
  • Auto-update youtube-dl (restart your container to update)

Usage

version: '3'

services:
  ytb-dl:
    container_name: ytb-dl
    image: wiserain/youtube-dl-server:latest
    restart: always
    network_mode: bridge
    ports:
      - ${PORT_TO_EXPOSE}:8080
    volumes:
      - ${DIR_TO_DOWNLOAD}:/youtube-dl
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=Asia/Seoul
      - YTBDL_O=%(title)s - [%(id)s].%(ext)s
      - YTBDL_F=bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]

Create and run your container as above, and then access to http://${DOCKER_HOST_IP}:${PORT_TO_EXPOSE}/youtube-dl

REST API

  • target url: /youtube-dl/q
  • method: POST
  • available parameters: url, audio, and acodec

Environment variables

ENVDescriptionDefault
PUID / PGIDuid and gid for running an app911 / 911
YTBDL_VEReither of latest or youtube-dl version, e.g. 2019.09.28latest
YTBDL_OOUTPUT TEMPLATE%(uploader)s/%(title)s.%(ext)s
YTBDL_FFORMAT SELECTIONbestvideo[ext=mp4][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best
YTBDL_Iset true to ignore youtube-dl errors, the same as passing --ignore-errors in commandline
YTBDL_SERVER_HOST0.0.0.0
YTBDL_SERVER_PORT8080
YTBDL_SERVER_ROOTset / if you want to access without a location path/youtube-dl
YTBDL_SERVER_USER / YTBDL_SERVER_PASSrequires both to activate basicauth

TODO

  • Support http basic auth

Tag summary

Content type

Image

Digest

Size

54.5 MB

Last updated

over 5 years ago

docker pull wiserain/youtube-dl-server