changeset 284:5ef99c47e636

More rules.
author Edho Arief <edho@myconan.net>
date Thu, 22 Dec 2011 15:00:08 +0700
parents 003b0c8870b3
children 624eead87f86
files bin/ren
diffstat 1 files changed, 22 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/bin/ren	Thu Nov 24 15:23:18 2011 +0700
+++ b/bin/ren	Thu Dec 22 15:00:08 2011 +0700
@@ -21,6 +21,7 @@
     $newname =~ s/\./ /g;
     $newname =~ s/,([a-z0-9]+)$/.$1/i;
   }
+  $newname =~ s/^Gundam Seed (\d+|\d+\[v2\])\.DVD\(H264\.AAC\)\[KAA\]/[KAA] Gundam SEED - $1 [DVD]/i;
   $newname =~ s/(\[ACX\])(Spiral)( - \d+) - .* (\[[a-f0-9]{8}\]\.mkv)$/$1 $2$3 $4/i;
   $newname =~ s/^Genesis of Aquarion - (\d+) \[3xR\]\[Blu-ray.720p.H264.FLAC.AC3\](v2|)/[3xR] Genesis of Aquarion - $1 [$2 720p BD]/;
   $newname =~ s/^Otogi Zoshi Act\.(\d+)\[x264 AAC\]\[SSP-Corp\]/[SSP-Corp] Otogi Zoshi - $1 /;
@@ -54,6 +55,7 @@
   $newname =~ s/\] Fortune Arterial Akai Yakusoku - /] Fortune Arterial - /;
   $newname =~ s/\[HorribleSubs\] Hunter X Hunter - /[HorribleSubs] Hunter x Hunter (2011) - /i;
   $newname =~ s/\] Ookami to Koushinryou - /] Spice and Wolf - /;
+  $newname =~ s/\] Saint Seiya The Lost Canvas - /] Saint Seiya - The Lost Canvas - /;
   $newname =~ s/\] Kamen Rider Blade /] Kamen Rider Blade /i;
   $newname =~ s/\] Mobile Suit Gundam AGE - /] Gundam AGE - /i;
   $newname =~ s/\] Soredemo Machi wa Mawatte Iru - /] Soredemo Machi wa Mawatteiru - /;
@@ -271,23 +273,34 @@
   $newname =~ s/ Clean (Opening|Ending) v2/ - $1 (Clean) [v2]/i;
   $newname =~ s/ Creditless (Opening|Ending) (\d+) / - $1 $2 (Clean) /i;
   $newname =~ s/ Ep(\d+) Creditless Ending / - Ending $1 (Clean) /i;
-  $newname =~ s/ (NCED|Ending Clean) / - Ending (Clean) /i;
-  $newname =~ s/ NCED(\d+) / - Ending $1 (Clean) /i;
-  $newname =~ s/ (NCOP|Opening Clean) / - Opening (Clean)/i;
+  $newname =~ s/ (NC-?ED|Ending Clean) / - Ending (Clean) /i;
+  $newname =~ s/ NC-?ED(\d+) / - Ending $1 (Clean) /i;
+  $newname =~ s/ (NC-?OP|Opening Clean) / - Opening (Clean)/i;
+  $newname =~ s/ NC-?OP(\d+) / - Opening $1 (Clean) /i;
   $newname =~ s/ OP / - Opening /;
   $newname =~ s/ (\d+-\d+) / - $1 /;
   $newname =~ s/ - - / - /g;
   $newname =~ s/ Ep / /ig;
   ##SLICED BREAD
+  #v2
   $newname =~ s/(\(|\[) *(10bit-v2) *(\)|\])/[v2]/i;
-  $newname =~ s/(\(|\[) *(h\.264-Hi10P|720x480|10-?bit|10bit 480p H264|640x360|640x360 H264 AAC|h264\.aac|hi10p|10bit|\d+th Release|x264\.aac|xvid|divx5\.2\.1|divx5\.1|divx5\.05|divx5\.1\.1|h\.?264 AC3|848x480|H264 848x480|h264-480p AAC|h\.264-480p) *(\)|\])//i;
+  #nothing
+  $newname =~ s/(\(|\[) *(640x480 DivX511 mp3|h\.264-Hi10P|720x480|10-?bit|10bit 480p H264|640x360|640x360 H264 AAC|h264\.aac|hi10p|10bit|\d+th Release|x264\.aac|xvid|divx5\.2\.1|divx5\.1|divx5\.05|divx5\.1\.1|h\.?264 AC3|848x480|H264 848x480|h264-480p AAC|h\.264-480p) *(\)|\])//i;
+  #dvd
   $newname =~ s/\[(DVD 10bit)\]/[DVD]/i;
-  $newname =~ s/(\(|\[) *(DVD H264 640x480|DVD H264 720x480 AAC|DVD 704x480 H264 AC3|DVD 704x480|DVDRip\.Xvid\.864x480\.Vorbis|DVD H264 848x480|DVD 720x480|DVD H264 720x480|DVD, wmv, mp3) *(\)|\])/[DVD]/i;
-  $newname =~ s/(\(|\[) *(BD\]\[1080p-FLAC|BD 1080|1920x1080 Hi10p h264 AAC|BD 1920x1080 x264 AAC|BD 1080p Hi10P|BDRip 1080p x264 FLAC|BD-1080p-|BD-1080p-FLAC|1920x1038 Blu-Ray FLAC|1920x1080 Blu-Ray FLAC|1920x1080 h264 BD FLAC|1920x1080 BD|BD\.1080p\.FLAC|BD 1080p H\.264 AAC 5\.1|BD 1080p) *(\)|\])/[1080p BD]/i;
+  #dvd again
+  $newname =~ s/(\(|\[) *(DVD 720x480 x264 FLAC|R1DVD 720x480 x264 AC-3|DVD 712x480 AC-3|DVD 720x480 AC-3|R\d DVD\.H264\.AC3|DVD 1024x576 x264 FLAC|DVD H264 640x480|DVD H264 720x480 AAC|DVD 704x480 H264 AC3|DVD 704x480|DVDRip\.Xvid\.864x480\.Vorbis|DVD H264 848x480|DVD 720x480|DVD H264 720x480|DVD, wmv, mp3) *(\)|\])/[DVD]/i;
+  #1080p BD
+  $newname =~ s/(\(|\[) *(BD\]\[h264-1080p FLAC|BD\]\[1080p-FLAC|BD 1080|1920x1080 Hi10p h264 AAC|BD 1920x1080 x264 AAC|BD 1080p Hi10P|BDRip 1080p x264 FLAC|BD-1080p-|BD-1080p-FLAC|1920x1038 Blu-Ray FLAC|1920x1080 Blu-Ray FLAC|1920x1080 h264 BD FLAC|1920x1080 BD|BD\.1080p\.FLAC|BD 1080p H\.264 AAC 5\.1|BD 1080p) *(\)|\])/[1080p BD]/i;
+  #720p
   $newname =~ s/(\(|\[) *(Hi10P 1280x720 H264|Hi10P 1280x720|1280x720 Hi10P|1280x720 5\.1|1280x720 x264 AAC|1280x720 H264 AAC|720p H264 AAC|1280x720|1280x720 H\.?264 AAC) *(\)|\])/[720p]/i;
-  $newname =~ s/(\(|\[) *(BD, 720, 10bit, AAC|BDrip 720p Vorbis|BD 720p Hi10P AAC|BD, 720p,|BD 720p H264-AAC|BDRip 720p|BD, 720p, ,|1280x720 BD|BD 1280x720 H264 AAC|BD 720p|BD 720p FLAC|BD 1280x720 H264 AAC) *(\)|\])/[720p BD]/i;
-  $newname =~ s/(\(|\[) *(BD 540p) *(\)|\])/[BD]/i;
+  #720p BD
+  $newname =~ s/(\(|\[) *(BD\]\[h264-720p\]\[FLAC|BD Hi10P 1280x720|BD, 720p, 10bit,|BD, 720, 10bit, AAC|BDrip 720p Vorbis|BD 720p Hi10P AAC|BD, 720p,|BD 720p H264-AAC|BDRip 720p|BD, 720p, ,|1280x720 BD|BD 1280x720 H264 AAC|BD 720p|BD 720p FLAC|BD 1280x720 H264 AAC) *(\)|\])/[720p BD]/i;
+  #BD
+  $newname =~ s/(\(|\[) *(Blu-Ray|BD 540p) *(\)|\])/[BD]/i;
+  #576p
   $newname =~ s/(\(|\[) *(1024x576|H264 1024x576) *(\)|\])/[576p]/i;
+  #1080p
   $newname =~ s/(\(|\[) *(1920x1080) *(\)|\])/[1080p]/i;
   ##SLICED BREAD pt.2
   $newname =~ s/(\d+)v(\d+)/$1 [v$2]/i;
@@ -472,6 +485,7 @@
   $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /;
   $newname =~ s/^Fairy Tail - (\d{2}) /Fairy Tail - 0$1 /;
   $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /;
+  $newname =~ s/\[(v\d+)\]\[(DVD)\]/[$1 $2]/i;
   if ($^O eq "MSWin32") { $newname =~ s/ *\\ */\\/g; }
   print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname;
   if ($_ eq $newname) {