thetonk / web-dlp

Self-hosted web interface for yt-dlp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Web-dlp

python-3.9 Linux LicenseGPLv3 maintained flask
Docker
Black-magic

web-dlp

A simple web interface for yt-dlp, with extra compatibility for Nextcloud file system and Nextcloud Music app.

Features

  • All video sources within the official list are supported.
  • Mass download videos and convert to either mp3 or mp4 format at the best quality possible.
  • Select resolution for single videos.
  • Transfer music to your local nextcloud instance and update all the required databases automatically.
  • Multi-threading support Temporarily not available, currently under development. Previous implementation had issue when processing big files.
  • Easy deployment with docker.

Configuring the docker-compose.yml file

I. Ports

Set to your preferred port. Default port is 6030.

II. Environment variables

Environment variables. They are pretty self-explanatory.

  • TZ : Sets your timezone, using the corresponding TZ identifier from this list.
  • OCC_PATH: Your path to the nextcloud occ script
  • NC_USER : Your nextcloud user
  • NC_MUSIC_DIRECTORY: Your nextcloud music directory path, as shown to your nextcloud instance
  • FLASK_SECRET_KEY: A secret key for flask. Required for various security reasons. You must change that
  • REDIS_HOST: Hostname or IP Address for redis. It's not required to change that for most cases, keep the value of docker-compose file.
  • REDIS_PASSWORD: Password for redis database. You must change that too.
  • REDIS_PORT: Port for redis. No need to change that, just like REDIS_HOST.

III. Volumes

This project requires 2 volumes;

  • Volume for your nextcloud music folder. This time use the ENTIRE path, not the one shown on your nextcloud instance
- /path/to/your/nextcloud/music/folder:/ytdlpFolder/Library
  • Volume for configuration and all necessary files. They're needed for transferring to nextcloud. See the next section for more.
- /dockerData/ytdlpweb/config:/config

(Optional) Transferring to Nextcloud

This is the kinda tricky part, but rewarding. It may get automatized on future releases. The steps are as such:

  1. Go to the config folder and create a FIFO file aka pipe, named mypipe (use name AS IS). Provide root priviledges if needed. This pipe will be the communication between the container and the host system.
$ cd /dockerData/ytdlpweb/config
$ mkfifo mypipe
  1. Create a script that forever reads the pipe and make it executable. For extra security, create it as root.
$ nano pipescript.sh
#!/bin/sh
while true; do eval "$(cat /dockerData/ytdlpweb/config/mypipe)"; done
$ chmod +x pipescript.sh
  1. Add the script to root's crontab so it starts on startup
$ sudo crontab -e
@reboot /dockerData/ytdlpweb/config/pipescript.sh

Aaaaand that's it!

Installation

  1. Clone this repository
$ git clone https://github.com/thetonk/web-dlp.git
  1. Build docker image. Provide root priviledges if required
$ docker build -t ytdlpweb .
  1. Deploy the previously created image using the properly configured docker-compose.yml file
$ docker compose up -d

About

Self-hosted web interface for yt-dlp

License:GNU General Public License v3.0


Languages

Language:Python 48.7%Language:HTML 41.6%Language:CSS 7.3%Language:Dockerfile 1.4%Language:Shell 1.0%