-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathripper
More file actions
executable file
·34 lines (25 loc) · 934 Bytes
/
ripper
File metadata and controls
executable file
·34 lines (25 loc) · 934 Bytes
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
#!/bin/bash
logToFile() {
echo "`date` | $1" >> "${LOGFILE}"
}
LOGFILE="~/ripperlog"
#Where do you store your media?
MEDIA="/media/Movies"
logToFile "DVD INSERTED | Launching Ripper"
logToFile "Sleeping for 8 seconds"
sleep 8;
logToFile "Mounting DVD"
mount /dev/dvd /media/dvd
title="$(lsdvd -c | grep "Disc Title" | gawk '{print $3}')"
logToFile "DVD Title is $title"
if [ -f $MEDIA/$title.mkv ]; then
die() { logToFile "$title already exists! Stopping" exit 1; }
else
logToFile "Ripping of $title will now start"
HandBrakeCLI --main-feature -i /media/dvd -o $MEDIA/$title.mkv -e x264 -q 20.0 -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 -f mp4 --loose-anamorphic --modulus 2 -m --x264-preset veryfast --h264-profile main --h264-level 4.0 > ~/handbrake-log
logToFile "Done ripping $title"
fi
logToFile "Unmounting and ejecting DVD"
umount /media/dvd
eject
fi