From 28e798af988286c1a8a375994d1d91eddaac6276 Mon Sep 17 00:00:00 2001 From: Michael De Roover Date: Thu, 27 Apr 2023 03:39:07 +0200 Subject: [PATCH] Clean up .part files, set LC_ALL if unset --- convert-psp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/convert-psp b/convert-psp index 148afb6..5f0c631 100755 --- a/convert-psp +++ b/convert-psp @@ -4,6 +4,11 @@ f_convert-psp(){ ffmpeg -y -i "$1" -flags +bitexact -vcodec libx264 -profile:v baseline -level 3.0 -s 480x272 -r 29.97 -b:v 384k -acodec aac -b:a 96k -ar 48000 -f psp -strict -2 "PSP/$1" } +f_delete_parts(){ + rm -r $directory/*.part + rm -r PSP/$directory/*.part +} + help(){ printf "Usage: $0\n" exit 1 @@ -21,6 +26,7 @@ nojson(){ saveifs=$IFS IFS=$'\n' +[ -z $LC_ALL ] && export LC_ALL=en_US.UTF-8 iterations=$(jq -r ".subscriptions | length" < subscriptions.json) for (( iteration=0; iteration<$iterations; iteration++ )) @@ -40,6 +46,7 @@ do [ ! -f "PSP/$directory/$file" ] && \ f_convert-psp "$directory"/"$file" done + f_delete_parts done IFS=$saveifs