Docker version of the ytdlwl project
clone this repository
git clone https://github.com/m1bcodes/ytdlwl-docker.git
Create Docker image:
docker build --tag ytdlwl ytdlwl-docker
Create a folder /srv/ytdlwl
which will hold the downloaded files. Change owner accordingly.
docker run -v /srv/ytdlwl:/app/downloads --mount "source=ytdlwl-cookies,target=/app/cookies" -it ytdlwl sh
For test purposes: start the download by calling sh update_wl.sh
.
Running the docker image will create the volume cookies /var/lib/docker/volumes/ytdlwl-cookies
.
Place the cookies as described in the ytdlwl repository in the cookies folder.
docker run -d --name ytdlwl -v /srv/ytdlwl:/app/downloads --mount "source=ytdlwl-cookies,target=/app/cookies" ytdlwl
To auto-start the container, e.g. after a reboot of the server, call
docker update --restart unless-stopped ytdlwl
To rebuild the stack after editing and to avoid re-use of cached components:
docker-compose up --force-recreate --build -d
This section describes the steps required to synchronize the downloaded videos with remote (raspberry pi) systems. They can run libreelec for instance.
Execute these steps on the machine, where docker-compose is run.
The remote machine is called rpi4
in this case.
ssh-keygen -o -a 100 -t ed25519
Allow the key file to be created in ~/.ssh
.
The public key is copied to the remote machine.
ssh-copy-id -i ~/.ssh/id_ed25519.pub root@rpi4
In order to avoid confirmation by ssh to accept the remote machine, since no fingerprint is known, we create a known_hosts
file, were the fingerprints of all machines are stored, which shall be syncronization targets.
Type the folling command for each remote machine:
ssh-keyscan -H rpi4 >> ./known_hosts
The known_hosts
file will be transferred as secret to the container.
Install the network tools addon (on libreelec) from the libreelec addon repository. The network tools can be found under program addons. This is necessary to have rsync available under libreelec.
The rsync command to be executed from the ytdlwl container is added to update_wl.sh:
rsync -avz --delete -e "ssh -i /run/secrets/ssh-key-prv -o UserKnownHostsFile=/run/secrets/ssh-known-hosts" /var/Videos/Youtube_WL root@rpi4:"/storage/videos"
- The ssh key (we need the private one) is per docker-compose copied to /run/secrets/ssh-key-prv`
- --delete to remove extra files on the destination folder.