-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsup2vob.sh
executable file
·114 lines (111 loc) · 2.24 KB
/
sup2vob.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash
#
# wrapper around bdsup2sub++ to convert subtitle files in batch
# and set the correct language
#
# Author: Peter Keel <seegras@discordia.ch>
# Date:
# Version: 0.2
# License: Public Domain
#
# Old version
# if ! command -v bdsup2sub++ >/dev/null 2>&1; then
# echo >&2 "bdsup2sub++ is required"
# exit 1
# fi
JARFILE="$HOME/lib/BDSup2Sub512.jar"
FLAGS="-Dsun.java2d.uiScale=2 -Dglass.gtk.uiScale=2.0"
if [[ ! -e "${JARFILE}" ]]; then
echo >&2 "${JARFILE} is required"
exit 1
fi
for FILE in *.sup; do
LANG3=$( echo "${FILE}" | cut -d "." -f 1 | rev | cut -c -3 | rev )
case "${LANG3}" in
bul)
LANG2="bg"
;;
chi)
LANG2="zh"
;;
cze)
LANG2="cs"
;;
dan)
LANG2="da"
;;
dut)
LANG2="nl"
;;
eng)
LANG2="en"
;;
fin)
LANG2="fi"
;;
fre)
LANG2="fr"
;;
ger)
LANG2="de"
;;
gre)
LANG2="el"
;;
heb)
LANG2="he"
;;
hin)
LANG2="hi"
;;
hun)
LANG2="hu"
;;
ita)
LANG2="it"
;;
ice)
LANG2="is"
;;
ind)
LANG2="id"
;;
jpn)
LANG2="ja"
;;
kor)
LANG2="ko"
;;
may)
LANG2="ms"
;;
nor)
LANG2="no"
;;
pol)
LANG2="pl"
;;
por)
LANG2="pt"
;;
rum)
LANG2="ro"
;;
spa)
LANG2="es"
;;
swe)
LANG2="sv"
;;
tha)
LANG2="th"
;;
tur)
LANG2="tr"
;;
esac
# Old version
# bdsup2sub++ --language $LANG2 -o $(basename $i .sup).idx $i;
#
java "${FLAGS}" -jar "${JARFILE}" --language "${LANG2}" -o "$( basename "${FILE}" .sup ).idx" "${FILE}";
done