Moving processing tools from hpr-hub repo to workflow

This commit is contained in:
2024-12-24 13:45:42 +01:00
parent db9b491324
commit 924e2fb0eb
7 changed files with 1159 additions and 17 deletions

View File

@@ -1,20 +1,8 @@
#!/bin/bash
# Copyright Ken Fallon - Released into the public domain. http://creativecommons.org/publicdomain/ ]
if [ -f "${1}" ]
then
mediainfo --Output=XML --Full "${1}" | xmlstarlet sel -T -t -m '/_:MediaInfo/_:media/_:track[@type="Audio"]' -v '_:Duration' -n | sed 's/0$//g'
exit 0
fi
find ./ -type f | grep -E -v '/sponsor-anhonesthost.com-hpr15.flac|/outro.flac|/intro.flac|/sponsor-archive.org.flac' | while read mediafile
do
if [ "$( file "${mediafile}" | grep -c audio )" == "0" ]
then
continue
fi
duration=$( mediainfo --full --Output=XML "${mediafile}" | xmlstarlet sel -T -t -m "_:MediaInfo/_:media/_:track[@type='Audio']/_:Duration[1]" -v "." -n - | sed 's/0$//g')
# Copyright Ken Fallon - Released into the public domain. http://creativecommons.org/publicdomain/
find ${HOME}/processing/ -type f | egrep -v '/sponsor-anhonesthost.com-hpr15.flac|/outro.flac|/intro.flac|/sponsor-archive.org.flac' | while read mediafile
do
duration=$( mediainfo --full --Output=XML "${mediafile}" | xmlstarlet sel -T -t -m "_:MediaInfo/_:media/_:track[@type='Audio']/_:Duration[1]" -v "." -n - | awk -F '.' '{print $1}' )
if [ "${duration}" != "" ]
then
echo "${mediafile}: ${duration}"
@@ -27,4 +15,3 @@ do
continue
fi
done