diff options
Diffstat (limited to 'qdsg.sh')
-rwxr-xr-x | qdsg.sh | 51 |
1 files changed, 49 insertions, 2 deletions
@@ -1,14 +1,61 @@ #!/bin/bash +run_ffmpeg_if_not_exist() { + local vid_input = $1 + local out_basename = $2 + local vid_codec = $3 + + ffmpeg -i "$vid_input" -c:v "$vid_codec" +} + +# generates multiple resolution for the given video files. +# $1: file name +# @return +encode_video() { + # name the input + local vid_input = $1 + local vid + + +} + +# ensure that the necessary directories exist mkdir -p out/ +mkdir -p out/video/mp4/ + +# copy robots.txt +echo "Copying robots.txt" +cp robots.txt out/ +# process every html site for inFile in in/*.html; do [ -e "$inFile" ] || continue echo "Processing file $inFile" filename=$(basename "$inFile") outFile="out/$filename" - cat header.html > "$outFile" - cat "$inFile" >> "$outFile" + + # get the title of the file if it is noted in the file + site_title="" + firstline=$(cat $inFile | head -n1) + [[ $firstline == TITLE:* ]] && { + site_title="$(echo $firstline | sed 's/TITLE: //g') - " + } + + # assemble the page + cat header.html | sed "s/%SITE_TITLE%/$site_title/g" > "$outFile" + if [[ $firstline == TITLE:* ]]; then + cat "$inFile" | tail -n +2 >> "$outFile" + else + echo -en "\t" && echo "$filename does not seem to have a title!" + cat "$inFile" >> "$outFile" + fi + cat footer.html >> "$outFile" done + +for inFile in videos/*; do + sleep 0 +done + + |