Last active
May 23, 2021 09:34
-
-
Save tyjak/48c17774a5adb5c1bd45def1a21bd16e to your computer and use it in GitHub Desktop.
copy all title of a dvd with handbrakecli
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
set -e | |
# copy all titles of dvd | |
# GistID:48c17774a5adb5c1bd45def1a21bd16e | |
dirpath="${1:-$(pwd)}" | |
title=$(HandBrakeCLI -i /dev/sr0 -t 0 2>&1 | grep "DVD Title:" | sed -E 's/.*DVD Title: (.*)$/\1/') | |
HandBrakeCLI -i /dev/sr0 -t 0 -v 2>&1 | grep '+ title' | sed -E "s@[^0-9]*([0-9]+):\$@HandBrakeCLI -i /dev/sr0 -m -t \1 -o \"${dirpath}/${title}_\1.mp4\"@" > /tmp/handbrake-tasks.sh | |
sh /tmp/handbrake-tasks.sh | |
#more ~/handbrake-sample.txt | grep '+ title' | sed -E "s@[^0-9]*([0-9]+):\$@HandBrake -t \1 -o \"$1 \1.mp4\"@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment