autorip 0.1.1

Composes other programs to automatically rip optical media
Documentation

autorip

Rust version of https://github.com/n8henrie/dvdrip.

Trying to logic in bash was just getting out of hand.

Overview

  1. Rip DVD, Bluray, or CD
  2. Eject DVD and send notification that it's done
  3. Try to find metadata based on DVD label
  4. Encode metadata and rename file to DVD title
  5. Transfer to media server with rsync

Dependencies

Quickstart

  • I use this on Arch, I don't expect it to be immediately usable for others, mostly pushing to GitHub for my purposes but also may be useful as a template.
  • Copy config-sample.env to config.env and add your data
  • sudo make install
  • The user running the script should have access to read optical media

The udev rule will automatically invoke dvdrip@bluray0.service (or dvdrip@dvd0.service) when a disc is inserted into the drive. This will send a warning to the prompt that a rip will begin shortly if the process isn't stopped (e.g. sudo systemctl kill dvdrip@bluray0.service). At that point, the DVD is ripped, renamed, and transfered per the settings above. If you have multiple optical drives, you may see e.g. dvd1 instead of dvd0.

videomd.sh can be used as a script independently to set metadata. If you run ./videomd.sh myfile.mp4, it will use the filename and set metadata based on the most popular search result. If you instead run ./videomd.sh -s myfile.mp4 or ./videomd.sh -s "my query here", it will instead display the top page of results for you, from which you can manually choose an id and then run with ./videomd.sh -i THE_ID myfile.mp4.

Notes

My shell scripting is not very good, I'm open to feedback. Especially on the best way to pass the new video name from videomd.sh back to autorip.sh (in order to be transfered back); my current strategy of "echo at the end and pipe to tail -n 1" seems super hacky.

handbraker.sh is not set to have execute permissions because HandbrakeCLI requires root permissions, so the Makefile puts it at a static location, changes it to 0700 root:root, then outputs the sha256 for a little extra security when setting it as a NOPASSWD executable.

License

The portions of this project that I have written are available under the MIT license.