From: Penny Leach Date: Tue, 1 May 2012 07:34:34 +0000 (+0200) Subject: fixed a bug & added some more exclusions to renametv X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0343e8ffb74ad31f812cbfc10d3136f6f1a56752;p=scripts.git fixed a bug & added some more exclusions to renametv --- diff --git a/bin/renametv.pl b/bin/renametv.pl index a7d8079..b763adc 100755 --- a/bin/renametv.pl +++ b/bin/renametv.pl @@ -13,7 +13,7 @@ my $somethingtodo = 0; my @usualsuspects = qw/ xvid xor ffndvd repack preair aaf 720p x264 dimension dvdrip hdtv 0tv fqm 2hd notv ws pdtv lol vtv xii dvdscr sys fov dot - vostfr p0w4 caph fihtv flatline brrip ac3 flawl3ss asap + vostfr p0w4 caph fihtv flatline brrip ac3 flawl3ss asap afg proper bufu notyou kfv immerse ctu webrip avdroid haggis orenji /; @@ -32,12 +32,13 @@ while (<$inputdir/*>) { s/'//g; s/-/_/g; s/[\[\]]//g; + s/_?season_?(\d+)[_|\.]?episode_(\d+)\./.$1$2./; s/\.[S|s]?(\d+)\.?[E|e|x|X]?(\d+)\./.$1$2./; s/\.0/./g; foreach my $bad (@usualsuspects) { s/(\[|\.|_|-)?$bad(\]|-)?//g; } - if (/^(.*\/(?!.*\/))([a-z0-9_.]*)((?:_|\.)[0-9]*)(?:_|\.)+([a-z_.,&]*)$/) { + if (/^(.*\/(?!.*\/))([a-z0-9_.]*)((?:_|\.)[0-9]*)(?:_|\.)+([a-z0-9_.,&]*)$/) { my ($path, $series, $epno, $title) = ($1, $2, $3, $4); $series =~ s/(_|\.)//g; $epno =~ s/.(.*)/$1/g;