GSRip

GSRip Commit Details

Date:2010-12-18 21:37:21 (12 years 9 months ago)
Author:Grégory Soutadé
Branch:master
Commit:34a6444a7557a5b962f964a0aa01309b2cfa3ad3
Parents: 673853e531b10288c325771796adf2429e96f83f
Message:Some improvments

Changes:
Mgsrip.sh (11 diffs)

File differences

gsrip.sh
1818
1919
2020
21
22
23
24
25
2126
2227
2328
......
156161
157162
158163
159
160
161
164
165
162166
163167
164168
165169
166170
167
168
169
171
172
170173
171174
172175
......
187190
188191
189192
190
191
192
193
194
193195
194196
195197
......
201203
202204
203205
204
205
206
207
206208
207209
208210
......
210212
211213
212214
213
214
215
215
216
217
216218
217219
218220
219221
220
222
221223
222224
223225
224
226
227
228
229
230
225231
226
232
227233
228234
229235
230
231
232
236
237
238
239
240
241
242
243
244
245
246
233247
234248
235
249
236250
237251
238252
......
257271
258272
259273
260
261
262
263
274
275
276
277
264278
265279
266280
......
279293
280294
281295
282
296
283297
284298
285299
......
310324
311325
312326
327
328
313329
314330
315331
......
323339
324340
325341
326
342
327343
328344
329345
......
331347
332348
333349
334
350
335351
336352
337353
......
349365
350366
351367
352
368
353369
set -e
CDDA2WAV=icedax
LAME=lame
OGGENC=oggenc
EDITORS="emacs vim gedit kate"
tmp=
function _exit()
;;
mp3)
encode_mp3=1
which lame > /dev/null
if [ ! $? ] ; then
echo "lame not found, cannot continue"
if [ "`which $LAME`" == "" ] ; then
echo "$LAME not found, cannot continue"
exit 1
fi
;;
ogg)
encode_ogg=1
which oggenc > /dev/null
if [ ! $? ] ; then
echo "oggenc not found, cannot continue"
if [ "`which $OGGENC`" == "" ] ; then
echo "$OGGENC not found, cannot continue"
exit 1
fi
;;
fi
if [ $resume = 0 ] ; then
which cdda2wav > /dev/null
if [ ! $? ] ; then
echo "cdda2wav not found, cannot continue"
if [ "`which $CDDA2WAV`" == "" ] ; then
echo "$CDDA2WAV not found, cannot continue"
exit 1
fi
if [ $retrieve_infos = 0 ] ; then
if [ ! -f "$audio_cddb" ] ; then
echo "$audio_cddb not found"
exit
echo "$audio_cddb not found"
exit
fi
cat "$audio_cddb"
echo
echo -n "> "
read response
if [ "$response" = "c" -o "$response" = "copy" ] ; then
echo /bin/cp audio.cddb /tmp
/bin/cp audio.cddb /tmp
exit
echo /bin/cp audio.cddb /tmp
/bin/cp "$audio_cddb" /tmp
exit
fi
[ ! -z "$response" -a $response != "y" -a $response = "yes" ] && exit
else
if [ $auto = 1 ] ; then
cdda2wav -D "$dev" -L 1 -J -v title
$CDDA2WAV -D "$dev" -L 1 -J -v title
else
# Info query
while [ 1 ] ; do
cdda2wav -D "$dev" -L 0 -J -v title
if [ "$response" = "e" -o "$response" = "edit" ] ; then
cat "$audio_cddb"
else
$CDDA2WAV -D "$dev" -L 0 -J -v title
fi
echo
echo "Is this correct ? (y[es], n[o], e[xit], c[opy])"
echo "Is this correct ? (y[es], n[o], q[uit], c[opy], e[dit])"
echo -n "> "
read response
if [ "$response" = "c" -o "$response" = "copy" ] ; then
echo /bin/cp audio.cddb /tmp
/bin/cp audio.cddb /tmp
exit
echo /bin/cp audio.cddb /tmp
/bin/cp "$audio_cddb" /tmp
exit
fi
if [ "$response" = "e" -o "$response" = "edit" ] ; then
for editor in $EDITORS ; do
if [ "`which $editor`" != "" ] ; then
$editor "$audio_cddb"
break
fi
done
fi
[ -z "$response" -o "$response" = "y" -o "$response" = "yes" ] && break
[ "$response" = "e" -o "$response" = "exit" ] && exit
[ "$response" = "q" -o "$response" = "quit" ] && exit
done
fi
fi
fi
# Suppress spaces
band=$(echo $band)
album=$(echo $album)
genre=$(echo $genre)
year=$(echo $year)
band=$(echo $band | sed "s;/;-;g")
album=$(echo $album | sed "s;/;-;g")
genre=$(echo $genre | sed "s;/;-;g")
year=$(echo $year | sed "s;/;-;g")
if [ $resume = 0 ] ; then
# Extract wav
tracknum=$((tracknum + 1))
done;
cdda2wav -B -D $dev $tracks
$CDDA2WAV -B -D $dev $tracks
fi
# Convert into mp3
[ -z "$title" ] && title="Audio Track $prefix"
title=$(echo $title | sed "s;/;-;g")
filename=$pattern
filename=$(echo $filename | sed "s/%g/$genre/g")
if [ $encode_mp3 = 1 ] ; then
if [ ! -f "$new_file.mp3" -o $overwrite = 1 ] ; then
lame -b $bitrate -h --tt "$title" --ta "$band" --tl "$album" --ty "$year" --tn $i --tg "$genre" --add-id3v2 $track_wav "$new_file.mp3"
$LAME -b $bitrate -h --tt "$title" --ta "$band" --tl "$album" --ty "$year" --tn $i --tg "$genre" --add-id3v2 $track_wav "$new_file.mp3"
else
echo "$new_file.mp3 already exists, skipping"
fi
if [ $encode_ogg = 1 ] ; then
if [ ! -f "$new_file.ogg" -o $overwrite = 1 ] ; then
oggenc -b $bitrate -q 10 -t "$title" -a "$band" --album "$album" -d "$year" -N $i -G "$genre" $track_wav -o "$new_file.mp3"
$OGGENC -b $bitrate -q 10 -t "$title" -a "$band" --album "$album" -d "$year" -N $i -G "$genre" $track_wav -o "$new_file.mp3"
else
echo "$new_file.ogg already exists, skipping"
fi
fi
done
echo "CD extracted into $dest"
echo "CD extracted into $dest/$dir"
exit

Archive Download the corresponding diff file

Branches