I need help creating/finishing a bash script. What I'm trying to do is to create the perfect YouTube-DL archiving script. As of now, the only thing I can do is download all of a Users' videos, embed subtitles, add metadata but I want to also autosub the files (with script number 2) and convert the downloaded files with ffmpeg or AVConv or handbrake-cli and then remove the video files when I have a successful conversion.
Script 1 (downloads videos skipping already downloaded ones)
youtube-dl -i -o "%(title)s-%(id)s.%(ext)s" --all-subs --embed-subs --embed-thumbnail --add-metadata --sleep-interval=20 --rate-limit=1M --exec 'youtube-dl2kodi.py -t tvshow -f {}' --download-archive .archive $(cat url.txt)
Note: youtube-dl2kodi.py creates Kodi compatible nfo files so I can view them properly on Kodi with metadata.
Script 2 (subtitles videos automatically using autosub)
for file in *I WANT TO AUTOSUB files in this directory and subdirectories*
do autosub -S de -D de "$file">> results.out
done
I want to merge script 1 and 2 and then encode the files and remove original video files (mp4, mkv and webm) if successful. My encoding preference is HEVC with CRF 23 and I don't want to encode the audio. I want to copy the audio. The final video would be a MKV file.