Skip to content

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

License

Notifications You must be signed in to change notification settings

xXluki98Xx/your-dl-server

 
 

Repository files navigation

GitHub license

your-dl-server

This project is a Branch/ Fork of the original work of manbearwiz.

Original Work: Very spartan Web and REST interface for downloading youtube videos onto a server. bottle + youtube-dl.


Bugs:

Features:

  • Improvement Threads: work of nachtjasmin

  • Fileserver: work of bsod64

  • Torrent Download: inspired by samukasmk

  • Extraction: i have written an extraction module to process the data specifically for personal purpose

  • Web-UI: i complicated the WebUI, so that the user can configure diffrent parameters

  • Download History: inspired by nbr23

  • Download:

    • wget
    • youtube-dl
    • torrent (magnetlink)

Planned:


This Version supported following arguments for youtube-dl:

  - url
  - youtube-dl or wget o
  - download streams: normal (single) or axel (multiple download streams)
  - reference link
  - title
  - path (for subfolder)
  - retries (standard 5)
  - min sleep (standard 2)
  - max sleep (standard 15)
  - bandwidth (standard unlimited)
  - username
  - password

screenshot


screenshot


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 -p 8080:8080 --name your-dl-server -v ./data/ydl-downloads:/tmp/ydl-downloads -v ./data/ydl-logs:/tmp/logs lramm/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: "lramm/your-dl-server"
    volumes:
      - ./data/ydl-logs:/tmp/logs
      - ./data/ydl-downloads:/tmp/ydl-downloads
    ports:
      - 8080:8080
    restart: always

Podman CLI

Podman can be used like the Docker CLI.

podman run -d -p 8080:8080 --name your-dl-server -v ./data/ydl-downloads:/tmp/ydl-downloads:Z -v ./data/ydl-logs:/tmp/logs:Z lramm/youtube-dl-server

K8S

An Example Config for Kubernetes is Provided in the k8s directory.

Python

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

sudo YDL_SERVER_PORT=8123 python3 -u ./youtube-dl-server.py

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/ and enter the requested {{url}}.

Curl

curl -X POST --data-urlencode "url={{url}}" http://{{host}}:8080/api/add

Fetch

fetch(`http://${host}:8080/api/add`, {
  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/api/add",{body:new URLSearchParams({url:window.location.href,format:"bestvideo"}),method:"POST"})}();

Downloading files

Simple Fileserver for Download or Streaming, navigate to http://hostip:port/downloads/


NOTE

Currently: Issue with Fileserver and Webpage, if you use both, it breaks after entering the Fileserver.


Implementation

The server uses bottle for the web framework and youtube-dl to handle the downloading.

This buildah image is based on python:3-alpine.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 85.2%
  • Smarty 9.4%
  • CSS 3.5%
  • Shell 1.3%
  • Dockerfile 0.6%