From 4fb0516a95eb0f6c3127a9fc1a272c73bb59814b Mon Sep 17 00:00:00 2001 From: kolaczyn Date: Fri, 26 Jun 2020 22:11:34 +0200 Subject: [PATCH] started making downloader --- download.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 download.sh diff --git a/download.sh b/download.sh new file mode 100644 index 0000000..3768f3d --- /dev/null +++ b/download.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# you give it an url, and it downloads videos, subs, converts them +# renaming should be done outside the program +#TODO make it so renaming is not nesseccary +# it should be easy to change a few things to make it possible +#also: add exception handling in gen-script.py + +#TODO offtopic make it so that you only download nesseccary files. +# first the program downloads subs and converts them +# then you search for the words. if you are certain you want these parts, +# it then downloads only nesseccary videos. if you already have them downloaded, +# it doesnt download them again. +# to do this, I'll probably have to generate a file with a list of +# videos in the playlist and it couldnt find any information how to do this +# worst come to worst, I'll have to write a program myself in Python with +# web scraping + +# https://www.youtube.com/playlist?list=PLFm1tTY1NA4eFO89sYmMDVghvH0m2wUmc + +url=$1 + +# download videos +cd ../original +youtube-dl -f 22 $url + +#download subs +cd ../subs +youtube-dl --write-auto-sub --skip-download $url + +#convert the subs +for filename in *; do + file="${filename%.*}"; + in="${file}.vtt" + out="${file}.srt" + ffmpeg -i $in $out + done + +# rename