Update subtitle-converter.sh
This commit is contained in:
parent
714d3c8cca
commit
e5acec3513
@ -4,6 +4,7 @@ function convert() {
|
||||
res=$(ffprobe -v error -show_entries stream=codec_type,codec_name -of compact "$1" | grep -s "subtitle");
|
||||
if [[ "$res" == *"ass"* ]]; then
|
||||
echo "Converting $1";
|
||||
ext="${1##*.}";
|
||||
ffmpeg -n -i "$1" -c:s srt "${i%.$ext}.srt" > /dev/null 2&> /dev/null;
|
||||
else
|
||||
echo "$1 not ASS. Skipping";
|
||||
@ -14,12 +15,10 @@ if [[ -d "$1" ]]; then
|
||||
cd "$1";
|
||||
shopt -s globstar
|
||||
for i in **/*; do
|
||||
ext="${i##*.}";
|
||||
convert "$i";
|
||||
done
|
||||
elif [[ -f "$1" ]]; then
|
||||
cd $(dirname "$1");
|
||||
name=$(basename "$1");
|
||||
ext="${name##*.}";
|
||||
convert "$name";
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user