This commit is contained in:
2025-09-08 09:49:49 +02:00
parent 1a69042b24
commit 27bb3be4af
8 changed files with 154 additions and 5 deletions

View File

@@ -0,0 +1,35 @@
#!/bin/bash
rsync -av --partial --progress hpr:hub.hackerpublicradio.org/upload/ $HOME/tmp/hpr/processing/
find $HOME/tmp/hpr/processing/*_*_????-??-??_* -type d | sort -t _ -k 2 | while read show_dir
do
echo "${show_dir}"
if [ "$( find "${show_dir}" -type f -iname "*srt" | wc -l )" -eq "0" ]
then
cd "${show_dir}"
ls -haltr
find "${show_dir}/" -type f -exec file {} \; | grep -Ei 'audio|mpeg|video|MP4' | awk -F ': ' '{print $1}' | while read this_media
do
whisper --model tiny --language en --output_dir "${show_dir}" "${this_media}"
done
rsync -av --partial --progress "${show_dir}/" hpr:hub.hackerpublicradio.org/upload/$( basename "${show_dir}")/
fi
done
rsync -av --partial --progress hpr:hub.hackerpublicradio.org/reserve/ $HOME/tmp/hpr/reserve/
find $HOME/tmp/hpr/reserve/*_*_* -type d | sort -t _ -k 2 | while read show_dir
do
echo "${show_dir}"
if [ "$( find "${show_dir}" -type f -iname "*srt" | wc -l )" -eq "0" ]
then
cd "${show_dir}"
ls -haltr
find "${show_dir}/" -type f -exec file {} \; | grep -Ei 'audio|mpeg|video|MP4' | awk -F ': ' '{print $1}' | while read this_media
do
whisper --model tiny --language en --output_dir "${show_dir}" "${this_media}"
done
rsync -av --partial --progress "${show_dir}/" hpr:hub.hackerpublicradio.org/reserve/$( basename "${show_dir}")/
fi
done