A fully automated DVD ripping pipeline powered by MakeMKV. Insert a disc, walk away β the script detects it, rips it, renames the output to a clean Title Case filename, organizes multi-part discs, and ejects the tray when it's done.
| Feature | Description |
|---|---|
| Auto-Detection | Dynamically finds any connected optical drive (USB or SATA) β no need to hardcode /dev/sr0 |
| Live Dashboard | Real-time terminal UI showing current status, progress bar, success/fail counters, and errors |
| Progress Bar | Parses MakeMKV's robot-mode output to display [########-------] 55% during rips |
| Smart Naming | Converts raw disc labels like THE_DARK_KNIGHT β The Dark Knight.mkv |
| Unlabeled Disc Fallback | Uses a timestamped Untitled_Disc_YYYYMMDD_HHMMSS name when a disc has no usable label |
| Multi-Part Support | Discs with multiple titles are automatically numbered _Part01, _Part02, etc. |
| Disk Space Check | Refuses to start a rip if less than 10 GB is available, preventing partial rips |
| Overwrite Protection | Refuses to replace existing rips with the same cleaned title |
| Auto-Eject | Pops the tray open after every rip (success or failure) so you can swap discs |
| Per-Disc Logging | Each rip generates its own log file for easy troubleshooting |
MakeMKV must be installed and makemkvcon must be available in your system PATH.
Install on Ubuntu/Debian:
sudo apt install makemkv-bin makemkv-ossVerify installation:
makemkvcon --helpNote: MakeMKV is free while in beta. If MakeMKV prompts for registration, use the current beta key from the official MakeMKV forum page or purchase a permanent key.
These are typically pre-installed on most Linux distributions:
# Verify all dependencies are present
which lsblk eject tput blockdev df findmnt| Tool | Purpose |
|---|---|
lsblk |
Detects optical drives and reads disc labels |
eject |
Opens the disc tray after ripping |
tput |
Controls terminal output for the dashboard (part of ncurses) |
blockdev |
Checks if a disc is physically present in the drive |
df |
Checks available disk space before ripping |
findmnt |
Verifies /media or /mnt storage paths are actually mounted |
- An optical DVD/Blu-ray drive (internal SATA or external USB)
- The drive must be recognized by the system as a
romtype device inlsblk
All settings are stored in config.env. This file must exist in the same directory as the script.
# Root directory where all rip data is stored
DRIVE_ROOT="$HOME/Desktop/DVD-Rips"
# Final destination for completed .mkv files
DEST_FOLDER="$DRIVE_ROOT/MakeMKV"
# Temporary working directory.
# Cleaned up after successful rips; retained when partial files need inspection.
BASE_TEMP="$DRIVE_ROOT/temp_rip_work"
# Minimum title length in seconds. Titles shorter than this are skipped.
# Examples: 900 = 15 min, 1800 = 30 min, 3600 = 60 min
MIN_LENGTH=900
# Minimum free disk space in GB required before starting a rip.
MIN_SPACE_GB=10
# Set to 1 only if DRIVE_ROOT under /media or /mnt is intentionally not a mount.
ALLOW_UNMOUNTED_DRIVE_ROOT=0| Variable | Default | Description |
|---|---|---|
DRIVE_ROOT |
$HOME/Desktop/DVD-Rips |
Root path for all rip-related storage |
DEST_FOLDER |
$DRIVE_ROOT/MakeMKV |
Where finished .mkv files are saved |
BASE_TEMP |
$DRIVE_ROOT/temp_rip_work |
Temporary directory during active rips; retained for partial files after unsafe failures |
MIN_LENGTH |
900 |
Minimum title length in seconds to include in the rip |
MIN_SPACE_GB |
10 |
Minimum free space required before starting a rip |
ALLOW_UNMOUNTED_DRIVE_ROOT |
0 |
Allows /media or /mnt paths that are not mounted; keep disabled for external drives |
git clone https://github.com/your-repo/DVD-Auto-Ripper.git
cd DVD-Auto-Ripperchmod +x auto_rip.shEdit config.env to match your system:
nano config.envMake sure the DRIVE_ROOT path exists, is mounted when using an external drive, and has sufficient storage space.
For the default example path:
mkdir -p "$HOME/Desktop/DVD-Rips"./auto_rip.shThe dashboard will appear immediately. Insert a DVD and the script will take it from there.
Press Ctrl+C at any time to stop the script. If a rip is in progress, MakeMKV will be interrupted and the temp directory for that disc will remain (it will be cleaned up automatically on the next run for the same disc).
When running, the terminal displays a live dashboard:
================================================
π DVD AUTO-RIPPER DASHBOARD
================================================
Status: Ripping: The Dark Knight [########-------] 55%
Last Activity: 14:32:07
------------------------------------------------
π STATS: Success: 3 | Fail: 0
β οΈ Last Error: None
================================================
πΏ New Disc Detected: The Dark Knight
β³ Ripping in background... Please wait.
| Status | Meaning |
|---|---|
Waiting for disc... |
Idle β polling the drive every 10 seconds |
Detecting: LABEL |
A new disc was found, cleaning the name |
Ripping: Name [Starting...] |
MakeMKV has launched, waiting for first progress update |
Ripping: Name [####...] XX% |
Actively ripping with real-time progress |
$HOME/Desktop/DVD-Rips/
βββ MakeMKV/ # Finished rips
β βββ The Dark Knight.mkv # Single-title disc
β βββ Persuasion_Part01.mkv # Multi-title disc
β βββ Persuasion_Part02.mkv
βββ temp_rip_work/ # Working directory
βββ logs/ # Per-disc log files
βββ rip_The Dark Knight.log
βββ rip_Persuasion.log
- Check the log file in
$BASE_TEMP/logs/for details - This usually means no titles on the disc met the
MIN_LENGTHthreshold - Try lowering
MIN_LENGTHinconfig.env(e.g., from900to300)
- Verify the drive is recognized:
lsblk -d -o NAME,TYPE | grep rom - If using USB, try unplugging and re-plugging the drive
- The script will automatically recover once the drive reappears
- The script requires at least 10 GB of free space on
$DRIVE_ROOT - Free up space or change
DRIVE_ROOTto a different volume
- The configured storage path looks like an external drive path, but the drive is not mounted
- Mount the drive before running the script
- Only set
ALLOW_UNMOUNTED_DRIVE_ROOT=1if you intentionally use a normal local directory under/mediaor/mnt
- The script refuses to overwrite existing
.mkvfiles with the same cleaned disc title - Rename or move the existing output before re-ripping the same disc
- Check the per-disc log in
$BASE_TEMP/logs/ - If partial
.mkvfiles were produced, the temp directory is left in place for inspection instead of being deleted
- The
--progress=-stdoutflag is required for MakeMKV to output progress data - Verify your MakeMKV version supports this flag:
makemkvcon --help
- The script sorts multi-title output by file modification time (oldest first)
- This matches the order MakeMKV ripped them, which corresponds to the disc's playback order
This project is provided as-is for personal use. MakeMKV has its own licensing terms β please refer to makemkv.com for details.