-
Notifications
You must be signed in to change notification settings - Fork 0
/
chapter-ripper.sh
35 lines (30 loc) · 1.3 KB
/
chapter-ripper.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
# Derek Moyes <derek (dot) moyes (at) gmail
# https://github.com/derekmoyes/handbrake-automation
### Fill in these variables ##################################################
# DVDPath, Linux /dev/dvd, Mac /dev/device, VIDEO_TS
dvdpath=/dev/dvd
videotitle=1
videochapters=53 ### Use the actual number of chapters
discname=OurVacationDisc1
# Encoder Tune: animation, film, grain, (Blank for none)
encodertune=film
storepath=/Users/yourusername/Movies ### No trailing slash
### Dont change stuff below here #############################################
ripcounter=1
rippath=$storepath/zAutoRipping-$discname
### Start the work ###########################################################
mkdir -p $rippath
### Rip the chapter files
while [ $ripcounter -le $videochapters ];
do
ripname=$rippath/$discname-t$videotitle-ch$ripcounter.mp4
echo Ripping Title $videotitle Chapter $ripcounter to $ripname
HandBrakeCLI --preset-import-gui -Z "General/HQ 1080p30 Surround" --encoder-tune $encodertune --input $dvdpath --output $ripname --title $videotitle -c $ripcounter --all-audio
((ripcounter++))
done
sleep 5
### Clean up #################################################################
zdonePath=$storepath/RipDone
mkdir -p $zdonePath
mv $rippath $zdonePath/$discname
echo Completed $discname, stored at $zdonePath.