Files
bin/fix_afl_md

20 lines
420 B
Bash
Executable File

#!/bin/bash
dir="/myth/opt/storage/other-videos/AFL/"
for year in `ls $dir`
do
echo "dir=/$dir/$year"
for file in `ls $dir/$year`
do
md=`MP4Box $dir/$year/$file -info 2>&1 | grep Name: | cut -f2- -d:`
echo -n " file=$file - md=$md"
if [[ ${md} =~ $year.AFL.(.*) ]]
then
new_md=${BASH_REMATCH[1]}
echo -n ", new_md=$new_md"
MP4Box -itags name="$new_md" $dir/$year/$file
fi
echo ""
done
done