X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=rip_movie;fp=rip_movie;h=207df80c674e83f5cb42daadba7514fc9b9ab2f6;hb=a526e6136c5c3d16327325dd05d7839149bccad1;hp=680e8bb672c065f919835cbc87b163ca9b0681a1;hpb=6dabeed9dce105a6b227a0e86549cdb51206e415;p=bin.git diff --git a/rip_movie b/rip_movie index 680e8bb..207df80 100755 --- a/rip_movie +++ b/rip_movie @@ -108,8 +108,6 @@ die "no title" if not defined $title; my $filename = lc($title); $filename =~ s/[\s_-]+/_/; -use Data::Dumper; - my @titles; for my $title_bit ($result =~ /\n(\+ title \d+:.+?)(?=\n\+ title\s+|$)/gs) { my %title; @@ -118,7 +116,7 @@ for my $title_bit ($result =~ /\n(\+ title \d+:.+?)(?=\n\+ title\s+|$)/gs) { $title{num} = $1; my ($duration) = $title_bit =~ /^\s+\+\s+duration:\s+([\d:]+)$/m; # HH:MM:SS, so (HH*60 + MM) * 60 + SS - $duration = reduce {$a * 60 + $b } split /:/, $duration; + $duration = reduce {defined $a and defined $b ? $a * 60 + $b : undef } split /:/, $duration; $title{duration} = $duration; # figure out audio tracks $title_bit =~ /(?\s+)\+\s+audio\s+tracks:\n # audio track header