Hey,
I'm planning to build a PC with 4x Blu-ray drives. I want to convert my entire Bluray collection to digital and play it with Jellyfin. I have just under 1,000 Bluray movies. But everything has to run smoothly. I wrote a script for this using ChatGPT and wanted to ask you if it will work. Maybe someone has a suitable script that I just need to modify a little.
Here is the script:
# Configuration
$makeMKVPath = "C:\Program Files (x86)\MakeMKV\makemkvcon.exe"
$outputPath = "D:\Rips" # Output directory for MKV files
$driveLetters = @("D", "E", "F", "G") # Blu-ray drive letters
$pollingInterval = 15 # Seconds between checks
function StartRip($driveLetter) {
$timestamp = Get-Date -Format "yyyy-MM-dd_HH-mm-ss"
$targetFolder = Join-Path $outputPath "$driveLetter-$timestamp"
New-Item -ItemType Directory -Path $targetFolder -Force | Out-Null
Write-Host "Starting rip for drive $driveLetter to $targetFolder"
Start-Process -FilePath $makeMKVPath -ArgumentList "mkv", "disc:0", "all", "--minlength=120", "--decrypt", "--noscan", "--directio=true", "--output=""$targetFolder""" -NoNewWindow
}
function IsDiscPresent($driveLetter) {
$vol = Get-Volume -DriveLetter $driveLetter -ErrorAction SilentlyContinue
return $vol -and $vol.FileSystem -eq "UDF"
}
# Main monitoring loop
$lastRipState = @{}
foreach ($drive in $driveLetters) {
$lastRipState[$drive] = $false
}
Write-Host "Monitoring drives: $($driveLetters -join ', ')"
Write-Host "Press CTRL+C to stop."
while ($true) {
foreach ($drive in $driveLetters) {
$discPresent = IsDiscPresent $drive
if ($discPresent -and -not $lastRipState[$drive]) {
Write-Host "Disc detected in $drive. Starting rip..."
StartRip $drive
$lastRipState[$drive] = $true
}
if (-not $discPresent -and $lastRipState[$drive]) {
Write-Host "Disc removed from $drive. Waiting for new disc..."
$lastRipState[$drive] = $false
}
}
Start-Sleep -Seconds $pollingInterval
}
Help with ripping script for 4x Blu-ray drives
Re: Help with ripping script for 4x Blu-ray drives
There are some functions in here I am not familiar with, so I would need to do some research & testing to determine 100% if this would function.
It overall looks good with 1 exception which is definitely incorrect, and the few things I am not sure of.
However, I think it would not hurt to run as-is if you fix the definite issue.
You have an output path to D: but then list your 4 Bluray drives including D:.
If D: is 1 of your 4 Bluray drives, it cannot be your output path.
1 of those 2 is therefore incorrect, either D: is your output path so you need to correct your list of Bluray drives or it is a Bluray drive so your $outputPath needs to be corrected to whichever drive letter is actually correct for your system and not a Bluray drive.
Nearly all Windows users have C: (no, not all do, but more than 99.999% do), but the extra drives can be whatever you set them to be so I cannot guess what is correct for you there.
It overall looks good with 1 exception which is definitely incorrect, and the few things I am not sure of.
However, I think it would not hurt to run as-is if you fix the definite issue.
See here?
You have an output path to D: but then list your 4 Bluray drives including D:.
If D: is 1 of your 4 Bluray drives, it cannot be your output path.
1 of those 2 is therefore incorrect, either D: is your output path so you need to correct your list of Bluray drives or it is a Bluray drive so your $outputPath needs to be corrected to whichever drive letter is actually correct for your system and not a Bluray drive.
Nearly all Windows users have C: (no, not all do, but more than 99.999% do), but the extra drives can be whatever you set them to be so I cannot guess what is correct for you there.