Skip to content

Instantly share code, notes, and snippets.

@orjanv
Created June 28, 2018 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orjanv/e9d76825e7998691dbb551adce1fd5a8 to your computer and use it in GitHub Desktop.
Save orjanv/e9d76825e7998691dbb551adce1fd5a8 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Thanks to https://github.com/sbutcher/ripomatic
INPUT_DEV=/dev/sr0
OUTPUT_FOLDER=$(pwd)
PRESET="High Profile"
LSDVDOUTPUT=$(lsdvd "$INPUT_DEV")
TITLE=$(echo "$LSDVDOUTPUT" | grep -i Disc | sed 's/Disc Title: //g')
LONGEST_TITLE=$(echo "$LSDVDOUTPUT" | sed '$!d' | sed 's/.*\(..\)/\1/')
echo "We will rip main feature: $TITLE from $INPUT_DEV to $OUTPUT_FOLDER using $PRESET"
HandBrakeCLI -t $LONGEST_TITLE -i $INPUT_DEV -a "1,2,3,4,5,6" -s "1,2,3,4,5,6,7,8,9" -o "$TITLE".m4v --preset "$PRESET" > hb.log 2>&1
eject $INPUT_DEV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment