@timmyx
Thanks for this guide, it really helped me.
I tried a few different docker applications to do the same, but it just didnt work as intended.
one thing i personally wanted to add to this guide is the creation of nfo files for the downloaded content, this helps emby show correct Title and Description of downloaded videos (dunno if it helps plex or other platforms).
First thing to do is download: YTDL-nfo into the defined settings folder:
also create the script post.sh in the defined settings folder:
#!/bin/bash
# Define argument as variable
file=$1
# Have a lock so that it only installs requirements once
lock=/post_install.lock
# Remove file name from path, but keep path in variable
file="${file%/*}/"
# Check if the lock file exists, if it dosent; install ytdl-nfo
if [ -e "$lock" ]; then
ytdl-nfo "$file"
else
touch $lock
apt update
apt install python3-pip -y
cd /settings/ytdl-nfo
pip install -r requirements.txt
pip install .
ytdl-nfo "$file"
fi
This script installs and runs ytdl-nfo from the downloaded source. and since this is docker, it installs the ytdl-nfo once on each restart of the docker container.
of course remember to set the script to executeable with "chmod +x post.sh"
now add two lines to the ytdl.conf file
--write-info-json
--exec 'bash /settings/post.sh {}'
This writes an info.json file for each video (required by ytdl-nfo).
It also runs post.sh each time a video is downloaded.
NOTE: there is a requirement to change the PUID in the container to 0 (root), this is unsafe but needed to allow the installation of pip and ytdl-nfo.
This is what it will look like in the log:
Future improvement would be to have ytdl-nfo preinstalled in the docker container