Put ripping scripts into separate folder
This commit is contained in:
parent
b3a8eb949d
commit
a18bfe5ea7
67
rip_dvd.pl
67
rip_dvd.pl
@ -1,67 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# Copy dvd with dvdbackup
|
||||
|
||||
sub trim {
|
||||
my $s = shift;
|
||||
$s =~ s/^\s+|\s+$//g;
|
||||
return $s
|
||||
}
|
||||
|
||||
sub printHelp {
|
||||
print
|
||||
"Usage: $0 [source]
|
||||
source: Dvd device to rip from
|
||||
Defaults to /dev/cdrom
|
||||
|
||||
Error-codes:
|
||||
0 - Success
|
||||
2 - Destination folder already exists
|
||||
* - Some unexpected error
|
||||
"
|
||||
}
|
||||
|
||||
my $startTime = `date +%s`;
|
||||
my $source = "/dev/cdrom";
|
||||
if($ARGV[0] eq "help" || $ARGV[0] eq "--help"){
|
||||
printHelp;
|
||||
exit 0;
|
||||
} elsif($ARGV[0]) {
|
||||
$source = $ARGV[0];
|
||||
}
|
||||
|
||||
my $dest = "/home/julian/Videos/dvds/";
|
||||
my $title = `lsdvd /dev/cdrom | grep "Disc Title"`;
|
||||
|
||||
if($? != 0){
|
||||
print "Failed reading dvd ($source). Could not get title\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$title = trim `echo $title | sed 's/Disc Title: //'`;
|
||||
|
||||
print "Ripping dvd $title ($source) to $dest\n";
|
||||
|
||||
if(-d $dest . $title) {
|
||||
print "Destination folder already exists!\n";
|
||||
exit 2;
|
||||
}
|
||||
|
||||
my $exitcode = system("dvdbackup -i $source -o $dest -M -n $title");
|
||||
# $exitcode >>= 8;
|
||||
|
||||
my $now = `date +%s`;
|
||||
my $elapsedTimeSeconds = $now - $startTime;
|
||||
my $elapsedTimeMinutes = $elapsedTimeSeconds / 60.0;
|
||||
my $elapsedTimeFormatted = sprintf "%.1f", $elapsedTimeMinutes;
|
||||
|
||||
if($exitcode == 0) {
|
||||
print "Success!\nRipping took $elapsedTimeFormatted min\n";
|
||||
system 'notify-send "DVD $title ripped successfully in ' . $elapsedTimeFormatted . ' min!!!"';
|
||||
system "mplayer /usr/share/sounds/freedesktop/stereo/bell.oga 2&> /dev/null";
|
||||
} else {
|
||||
print "Error!\nRipping took $elapsedTimeFormatted min\n";
|
||||
system 'notify-send "Error ripping DVD $title !!!"';
|
||||
system "mplayer /usr/share/sounds/freedesktop/stereo/bell.oga 2&> /dev/null";
|
||||
}
|
||||
# `eject $source`;
|
@ -1,3 +0,0 @@
|
||||
# !/bin/sh
|
||||
|
||||
ffmpeg -y -i "$1" -i "$2" -filter_complex '[1:v]format=yuva444p,lut=c3=128,negate[video2withAlpha],[0:v][video2withAlpha]overlay[out]' -map [out] video_diff.mov
|
Loading…
x
Reference in New Issue
Block a user