comparison bin/ren @ 284:5ef99c47e636

More rules.
author Edho Arief <edho@myconan.net>
date Thu, 22 Dec 2011 15:00:08 +0700
parents 1e214a53237d
children d55ff9c0158a
comparison
equal deleted inserted replaced
271:003b0c8870b3 284:5ef99c47e636
19 if ($newname =~ m/\[(Doremi|Elysium)/) { 19 if ($newname =~ m/\[(Doremi|Elysium)/) {
20 $newname =~ s/\.([a-z0-9]+)$/,$1/i; 20 $newname =~ s/\.([a-z0-9]+)$/,$1/i;
21 $newname =~ s/\./ /g; 21 $newname =~ s/\./ /g;
22 $newname =~ s/,([a-z0-9]+)$/.$1/i; 22 $newname =~ s/,([a-z0-9]+)$/.$1/i;
23 } 23 }
24 $newname =~ s/^Gundam Seed (\d+|\d+\[v2\])\.DVD\(H264\.AAC\)\[KAA\]/[KAA] Gundam SEED - $1 [DVD]/i;
24 $newname =~ s/(\[ACX\])(Spiral)( - \d+) - .* (\[[a-f0-9]{8}\]\.mkv)$/$1 $2$3 $4/i; 25 $newname =~ s/(\[ACX\])(Spiral)( - \d+) - .* (\[[a-f0-9]{8}\]\.mkv)$/$1 $2$3 $4/i;
25 $newname =~ s/^Genesis of Aquarion - (\d+) \[3xR\]\[Blu-ray.720p.H264.FLAC.AC3\](v2|)/[3xR] Genesis of Aquarion - $1 [$2 720p BD]/; 26 $newname =~ s/^Genesis of Aquarion - (\d+) \[3xR\]\[Blu-ray.720p.H264.FLAC.AC3\](v2|)/[3xR] Genesis of Aquarion - $1 [$2 720p BD]/;
26 $newname =~ s/^Otogi Zoshi Act\.(\d+)\[x264 AAC\]\[SSP-Corp\]/[SSP-Corp] Otogi Zoshi - $1 /; 27 $newname =~ s/^Otogi Zoshi Act\.(\d+)\[x264 AAC\]\[SSP-Corp\]/[SSP-Corp] Otogi Zoshi - $1 /;
27 $newname =~ s/(Ending) (\(Clean\)) - 0(\d+)/$1 $3 $2/; 28 $newname =~ s/(Ending) (\(Clean\)) - 0(\d+)/$1 $3 $2/;
28 $newname =~ s/(Opening) (\(Clean\))0(\d+)/$1 $3 $2/; 29 $newname =~ s/(Opening) (\(Clean\))0(\d+)/$1 $3 $2/;
52 $newname =~ s/\] Seikon no Qwaser II BD - (\d+) \[720p\]/] Seikon no Qwaser II - $1 [720p BD]/i; 53 $newname =~ s/\] Seikon no Qwaser II BD - (\d+) \[720p\]/] Seikon no Qwaser II - $1 [720p BD]/i;
53 $newname =~ s/\] Seikon no Qwaser Picture Drama - (\d+) /] Seikon no Qwaser - Picture Drama $1 /i; 54 $newname =~ s/\] Seikon no Qwaser Picture Drama - (\d+) /] Seikon no Qwaser - Picture Drama $1 /i;
54 $newname =~ s/\] Fortune Arterial Akai Yakusoku - /] Fortune Arterial - /; 55 $newname =~ s/\] Fortune Arterial Akai Yakusoku - /] Fortune Arterial - /;
55 $newname =~ s/\[HorribleSubs\] Hunter X Hunter - /[HorribleSubs] Hunter x Hunter (2011) - /i; 56 $newname =~ s/\[HorribleSubs\] Hunter X Hunter - /[HorribleSubs] Hunter x Hunter (2011) - /i;
56 $newname =~ s/\] Ookami to Koushinryou - /] Spice and Wolf - /; 57 $newname =~ s/\] Ookami to Koushinryou - /] Spice and Wolf - /;
58 $newname =~ s/\] Saint Seiya The Lost Canvas - /] Saint Seiya - The Lost Canvas - /;
57 $newname =~ s/\] Kamen Rider Blade /] Kamen Rider Blade /i; 59 $newname =~ s/\] Kamen Rider Blade /] Kamen Rider Blade /i;
58 $newname =~ s/\] Mobile Suit Gundam AGE - /] Gundam AGE - /i; 60 $newname =~ s/\] Mobile Suit Gundam AGE - /] Gundam AGE - /i;
59 $newname =~ s/\] Soredemo Machi wa Mawatte Iru - /] Soredemo Machi wa Mawatteiru - /; 61 $newname =~ s/\] Soredemo Machi wa Mawatte Iru - /] Soredemo Machi wa Mawatteiru - /;
60 $newname =~ s/\] Spiral - (\d+) .* \[640 x 480\]\[H\.264\]/] Spiral - $1 /; 62 $newname =~ s/\] Spiral - (\d+) .* \[640 x 480\]\[H\.264\]/] Spiral - $1 /;
61 $newname =~ s/\] Mayo Chiki - / ] Mayo Chiki! - /i; 63 $newname =~ s/\] Mayo Chiki - / ] Mayo Chiki! - /i;
269 $newname =~ s/ OP(\d+[a-z]*)/ - Opening $1 /i; 271 $newname =~ s/ OP(\d+[a-z]*)/ - Opening $1 /i;
270 $newname =~ s/ ED / - Ending /; 272 $newname =~ s/ ED / - Ending /;
271 $newname =~ s/ Clean (Opening|Ending) v2/ - $1 (Clean) [v2]/i; 273 $newname =~ s/ Clean (Opening|Ending) v2/ - $1 (Clean) [v2]/i;
272 $newname =~ s/ Creditless (Opening|Ending) (\d+) / - $1 $2 (Clean) /i; 274 $newname =~ s/ Creditless (Opening|Ending) (\d+) / - $1 $2 (Clean) /i;
273 $newname =~ s/ Ep(\d+) Creditless Ending / - Ending $1 (Clean) /i; 275 $newname =~ s/ Ep(\d+) Creditless Ending / - Ending $1 (Clean) /i;
274 $newname =~ s/ (NCED|Ending Clean) / - Ending (Clean) /i; 276 $newname =~ s/ (NC-?ED|Ending Clean) / - Ending (Clean) /i;
275 $newname =~ s/ NCED(\d+) / - Ending $1 (Clean) /i; 277 $newname =~ s/ NC-?ED(\d+) / - Ending $1 (Clean) /i;
276 $newname =~ s/ (NCOP|Opening Clean) / - Opening (Clean)/i; 278 $newname =~ s/ (NC-?OP|Opening Clean) / - Opening (Clean)/i;
279 $newname =~ s/ NC-?OP(\d+) / - Opening $1 (Clean) /i;
277 $newname =~ s/ OP / - Opening /; 280 $newname =~ s/ OP / - Opening /;
278 $newname =~ s/ (\d+-\d+) / - $1 /; 281 $newname =~ s/ (\d+-\d+) / - $1 /;
279 $newname =~ s/ - - / - /g; 282 $newname =~ s/ - - / - /g;
280 $newname =~ s/ Ep / /ig; 283 $newname =~ s/ Ep / /ig;
281 ##SLICED BREAD 284 ##SLICED BREAD
285 #v2
282 $newname =~ s/(\(|\[) *(10bit-v2) *(\)|\])/[v2]/i; 286 $newname =~ s/(\(|\[) *(10bit-v2) *(\)|\])/[v2]/i;
283 $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; 287 #nothing
288 $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;
289 #dvd
284 $newname =~ s/\[(DVD 10bit)\]/[DVD]/i; 290 $newname =~ s/\[(DVD 10bit)\]/[DVD]/i;
285 $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; 291 #dvd again
286 $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; 292 $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;
293 #1080p BD
294 $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;
295 #720p
287 $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; 296 $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;
288 $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; 297 #720p BD
289 $newname =~ s/(\(|\[) *(BD 540p) *(\)|\])/[BD]/i; 298 $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;
299 #BD
300 $newname =~ s/(\(|\[) *(Blu-Ray|BD 540p) *(\)|\])/[BD]/i;
301 #576p
290 $newname =~ s/(\(|\[) *(1024x576|H264 1024x576) *(\)|\])/[576p]/i; 302 $newname =~ s/(\(|\[) *(1024x576|H264 1024x576) *(\)|\])/[576p]/i;
303 #1080p
291 $newname =~ s/(\(|\[) *(1920x1080) *(\)|\])/[1080p]/i; 304 $newname =~ s/(\(|\[) *(1920x1080) *(\)|\])/[1080p]/i;
292 ##SLICED BREAD pt.2 305 ##SLICED BREAD pt.2
293 $newname =~ s/(\d+)v(\d+)/$1 [v$2]/i; 306 $newname =~ s/(\d+)v(\d+)/$1 [v$2]/i;
294 $newname =~ s/\[BD\]\[1920x1080 H264-Flac\]/[1080p BD]/i; 307 $newname =~ s/\[BD\]\[1920x1080 H264-Flac\]/[1080p BD]/i;
295 $newname =~ s/\[BD\]\[720p-AAC\]/[720p BD]/i; 308 $newname =~ s/\[BD\]\[720p-AAC\]/[720p BD]/i;
470 $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/; 483 $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/;
471 $newname =~ s/^\[([&!\.\s\w\- ]+)\] (Air Master|Crystal Blaze|Fairy Tail|Yawara|Ultraviolet Code 044|Gintama|Prince of Tennis|Lupin III S2|Kyou Kara Maou|Bleach|Naruto|One Piece|Detective Conan) - (Ending \d+|Opening \d+|Special \d+|\d+|\d+-\d+) /$2 - $3 [$1]/; 484 $newname =~ s/^\[([&!\.\s\w\- ]+)\] (Air Master|Crystal Blaze|Fairy Tail|Yawara|Ultraviolet Code 044|Gintama|Prince of Tennis|Lupin III S2|Kyou Kara Maou|Bleach|Naruto|One Piece|Detective Conan) - (Ending \d+|Opening \d+|Special \d+|\d+|\d+-\d+) /$2 - $3 [$1]/;
472 $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /; 485 $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /;
473 $newname =~ s/^Fairy Tail - (\d{2}) /Fairy Tail - 0$1 /; 486 $newname =~ s/^Fairy Tail - (\d{2}) /Fairy Tail - 0$1 /;
474 $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /; 487 $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /;
488 $newname =~ s/\[(v\d+)\]\[(DVD)\]/[$1 $2]/i;
475 if ($^O eq "MSWin32") { $newname =~ s/ *\\ */\\/g; } 489 if ($^O eq "MSWin32") { $newname =~ s/ *\\ */\\/g; }
476 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname; 490 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname;
477 if ($_ eq $newname) { 491 if ($_ eq $newname) {
478 print("$_: no need to rename, skipping\n"); 492 print("$_: no need to rename, skipping\n");
479 } else { 493 } else {