xcodian / youtube-dl-web

A good web interface for youtube-dl that allows you to download arbitrary mixes of audio and video, including up to the highest quality such as 8K.
Mozilla Public License 2.0
266 stars 61 forks source link
docker docker-compose downloader fastapi gui https material-design nginx react typescript youtube youtube-dl youtube-dl-gui youtube-downloader youtube-downloader-gui yt-dlp

πŸš€ youtube-dl-web

A good web interface for youtube-dl that allows you to download arbitrary mixes of audio and video, including up to the highest quality such as 8K.

Sadly, the public hosted website has been shut down. You are free to host this tool yourself!

Screenshot of the Webpage

Motive

There is no user-friendly method to download the highest quality of a YouTube video, without errors, and without installing software on your computer.

The web application, youtube-dl-web aims to create a user-friendly interface for downloading such videos.

Features

Hosting Yourself

Architecture

Youtube-dl-web relies on three main components:

The API server and the NGINX Proxy can most easily be deployed using Docker Compose. The frontend can be built manually with yarn, although a build script which accomplishes this in a platform independent way (using a temporary Docker container) is included.

Getting Started

For the hosting experience to be smooth for everyone, youtube-dl-web can be easily deployed using Docker Compose in a secure manner, secluded from your host operating system and without you having to install any dependencies.

Step 1: Install Docker and Docker Compose

Verify you have them installed with:

$ docker --version
Docker version 20.10.12

$ docker-compose --version
Docker Compose version 2.2.3

The actual versions don't matter much, just about anything should do!

If you're on an ARM system, such as a Raspberry Pi (untested) you can install Docker Compose as so:

$ sudo curl -L --fail https://raw.githubusercontent.com/linuxserver/docker-docker-compose/master/run.sh -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose

Step 3: Clone this repo

$ git clone https://github.com/xxcodianxx/youtube-dl-web

:warning: This tutorial assumes you are running the following commands as UID 1000. Make sure the folders are owned by UID 1000 & GID 1000, as the automatic containerized build process depends on it.

$ chown -R 1000:1000 youtube-dl-web

Step 2: Build Frontend Static Files

This makes sure that all of the HTML is compiled ready for the webserver to serve.

$ cd frontend
$ bash ./build.sh

Step 3: Start the Docker Compose cluster

This will start all the necessary containers in their environments.

$ cd ..
$ docker-compose up -d --build

That's it!

You can look at your running containers with:

$ docker-compose ps

And view their logs with:

$ docker-compose logs -f

SSL

The steps above describe running youtube-dl-web without SSL, meaning that all traffic sent to and from your webserver is over the internet in the clear!

It's not like there's that much sensitive data being sent over, but it's nice to have HTTPS support.

For home hosting, this is not required at all.

Obtaining SSL Certificates

The NGINX config is set up for Let's Encrypt certificates.

Once generated with certbot, they can be found in /etc/letsencrypt/live/yourdomain.example.net/*.pem

Enabling SSL Support

Add your certificates (files fullchain.pem and privkey.pem) into the nginx/certs directory. You can obtain these from Let's Encrypt with certbot.

First, stop the cluster if you have it running:

$ docker-compose down

Then, go into the docker-compose.yml file and follow the commented directions.

After this, repeat step 3 again, and you should be good to go!