Mercurial > ec-dotfiles
comparison bin/ren @ 138:f963d52c031a
Merge.
author | Edho Arief <edho@myconan.net> |
---|---|
date | Wed, 02 Nov 2011 22:12:16 +0700 |
parents | 983beb13c736 cf328bd06078 |
children | fbb03c862b63 |
comparison
equal
deleted
inserted
replaced
137:983beb13c736 | 138:f963d52c031a |
---|---|
11 my $newname = $_; | 11 my $newname = $_; |
12 #START HERE | 12 #START HERE |
13 $newname =~ s/_/ /g; | 13 $newname =~ s/_/ /g; |
14 # GROUP NAMES | 14 # GROUP NAMES |
15 $newname =~ s/\[UTW Mazui\]/[UTW-Mazui]/i; | 15 $newname =~ s/\[UTW Mazui\]/[UTW-Mazui]/i; |
16 $newname =~ s/\[t-n\]/[T-N]/i; | |
16 #TITLE AND NAMES | 17 #TITLE AND NAMES |
17 $newname =~ s/^(\(|\[)W B(\)|\])/[W_B]/; | 18 $newname =~ s/^(\(|\[)W B(\)|\])/[W_B]/; |
18 if ($newname =~ m/\[(Doremi|Elysium)/) { | 19 if ($newname =~ m/\[(Doremi|Elysium)/) { |
19 $newname =~ s/\.([a-z0-9]+)$/,$1/i; | 20 $newname =~ s/\.([a-z0-9]+)$/,$1/i; |
20 $newname =~ s/\./ /g; | 21 $newname =~ s/\./ /g; |
21 $newname =~ s/,([a-z0-9]+)$/.$1/i; | 22 $newname =~ s/,([a-z0-9]+)$/.$1/i; |
22 } | 23 } |
23 $newname =~ s/^Genesis of Aquarion - (\d+) \[3xR\]\[Blu-ray.720p.H264.FLAC.AC3\](v2|)/[3xR] Genesis of Aquarion - $1 [$2 720p BD]/; | 24 $newname =~ s/^Genesis of Aquarion - (\d+) \[3xR\]\[Blu-ray.720p.H264.FLAC.AC3\](v2|)/[3xR] Genesis of Aquarion - $1 [$2 720p BD]/; |
24 $newname =~ s/^Otogi Zoshi Act\.(\d+)\[x264 AAC\]\[SSP-Corp\]/[SSP-Corp] Otogi Zoshi - $1 /; | 25 $newname =~ s/^Otogi Zoshi Act\.(\d+)\[x264 AAC\]\[SSP-Corp\]/[SSP-Corp] Otogi Zoshi - $1 /; |
25 $newname =~ s/Onii-chan no Koto Nanka Zenzen Suki Janain Dakara ne!! - (\d+) \[Uncut\]/Onii-chan no Koto Nanka Zenzen Suki Janain Dakara ne!! - $1 /; | 26 $newname =~ s/Onii-chan no Koto Nanka Zenzen Suki Janain Dakara ne!! - (\d+) \[Uncut\]/Onii-chan no Koto Nanka Zenzen Suki Janain Dakara ne!! - $1 /; |
27 $newname =~ s/^(Ayashi no Ceres|Chikyuu Shoujo Arjuna|Futari wa Precure Splash Star) - (\d+)\[\d+\] - .*(\[DVD\])(\[[^]]+\])(\[[a-f0-9]{8}\]\.[^.]+)$/$4 $1 - $2 $3$5/i; | |
28 $newname =~ s/^(Futari wa Precure Splash Star) - (C\d+)\[\d+\] - .*(\[DVD\])(\[[^]]+\])(\[[a-f0-9]{8}\]\.[^.]+)$/$4 $1 - $2 $3$5/i; | |
29 $newname =~ s/^(Air Master|Black Jack Special|Cinderella Boy|Damekko Doubutsu|Crystal Blaze) - (\d+)\[\d+\] - .*(\[[^]]+\])(\[[a-f0-9]{8}\]\.[^.]+)$/$3 $1 - $2 $4/i; | |
26 $newname =~ s/^cor\.extras\.infinite\.ryvius\.textless\.opening(\d+)\./[cor] Infinite Ryvius - Opening $1 (Clean) /; | 30 $newname =~ s/^cor\.extras\.infinite\.ryvius\.textless\.opening(\d+)\./[cor] Infinite Ryvius - Opening $1 (Clean) /; |
27 $newname =~ s/^cor\.extras\.infinite\.ryvius\.textless\.ending(\d+)\./[cor] Infinite Ryvius - Ending $1 (Clean) /; | 31 $newname =~ s/^cor\.extras\.infinite\.ryvius\.textless\.ending(\d+)\./[cor] Infinite Ryvius - Ending $1 (Clean) /; |
28 $newname =~ s/^cor\.extras\.infinite\.ryvius\.art\.gallery\.and\.audio\.drama(\d+)\./[cor] Infinite Ryvius - Picture Drama $1 /; | 32 $newname =~ s/^cor\.extras\.infinite\.ryvius\.art\.gallery\.and\.audio\.drama(\d+)\./[cor] Infinite Ryvius - Picture Drama $1 /; |
29 $newname =~ s/^cor\.extras\.infinite\.ryvius\.ryvius\.vj\.mix(\d+)\./[cor] Infinite Ryvius - Ryvius VJ Mix $1 /; | 33 $newname =~ s/^cor\.extras\.infinite\.ryvius\.ryvius\.vj\.mix(\d+)\./[cor] Infinite Ryvius - Ryvius VJ Mix $1 /; |
30 $newname =~ s/^cor\.extras\.infinite\.ryvius\.ryvius\.illusion(\d+)\.mini-episode(\d+)\./[cor] Infinite Ryvius - Ryvius Illusion $1 - Mini Episode $2 /; | 34 $newname =~ s/^cor\.extras\.infinite\.ryvius\.ryvius\.illusion(\d+)\.mini-episode(\d+)\./[cor] Infinite Ryvius - Ryvius Illusion $1 - Mini Episode $2 /; |
41 $newname =~ s/\] Shakugan no Shana III /] Shakugan no Shana Final /i; | 45 $newname =~ s/\] Shakugan no Shana III /] Shakugan no Shana Final /i; |
42 $newname =~ s/\] Boku Ha Tomodachi Ga Sukunai - /] Boku wa Tomodachi ga Sukunai - /i; | 46 $newname =~ s/\] Boku Ha Tomodachi Ga Sukunai - /] Boku wa Tomodachi ga Sukunai - /i; |
43 $newname =~ s/\] Seikon no Qwaser II BD - (\d+) \[720p\]/] Seikon no Qwaser II - $1 [720p BD]/i; | 47 $newname =~ s/\] Seikon no Qwaser II BD - (\d+) \[720p\]/] Seikon no Qwaser II - $1 [720p BD]/i; |
44 $newname =~ s/\] Seikon no Qwaser Picture Drama - (\d+) /] Seikon no Qwaser - Picture Drama $1 /i; | 48 $newname =~ s/\] Seikon no Qwaser Picture Drama - (\d+) /] Seikon no Qwaser - Picture Drama $1 /i; |
45 $newname =~ s/\] Fortune Arterial Akai Yakusoku - /] Fortune Arterial - /; | 49 $newname =~ s/\] Fortune Arterial Akai Yakusoku - /] Fortune Arterial - /; |
50 $newname =~ s/\[HorribleSubs\] Hunter X Hunter - /[HorribleSubs] Hunter x Hunter (2011) - /i; | |
46 $newname =~ s/\] Ookami to Koushinryou - /] Spice and Wolf - /; | 51 $newname =~ s/\] Ookami to Koushinryou - /] Spice and Wolf - /; |
52 $newname =~ s/\] Kamen Rider Blade /] Kamen Rider Blade /i; | |
47 $newname =~ s/\] Mobile Suit Gundam AGE - /] Gundam AGE - /i; | 53 $newname =~ s/\] Mobile Suit Gundam AGE - /] Gundam AGE - /i; |
48 $newname =~ s/\] Soredemo Machi wa Mawatte Iru - /] Soredemo Machi wa Mawatteiru - /; | 54 $newname =~ s/\] Soredemo Machi wa Mawatte Iru - /] Soredemo Machi wa Mawatteiru - /; |
49 $newname =~ s/\] Spiral - (\d+) .* \[640 x 480\]\[H\.264\]/] Spiral - $1 /; | 55 $newname =~ s/\] Spiral - (\d+) .* \[640 x 480\]\[H\.264\]/] Spiral - $1 /; |
50 $newname =~ s/\] Mayo Chiki - / ] Mayo Chiki! - /i; | 56 $newname =~ s/\] Mayo Chiki - / ] Mayo Chiki! - /i; |
51 $newname =~ s/\] Naruto Shippuden - /] Naruto Shippuuden - /i; | 57 $newname =~ s/\] Naruto Shippuden - /] Naruto Shippuuden - /i; |
66 $newname =~ s/\[TSuNDeRe\]Tsuyokiss\.(\d+)\./[Tsundere] Tsuyokiss - $1 /i; | 72 $newname =~ s/\[TSuNDeRe\]Tsuyokiss\.(\d+)\./[Tsundere] Tsuyokiss - $1 /i; |
67 $newname =~ s/\[RANDOMFAGGOTS\]/[Randomfaggots]/i; | 73 $newname =~ s/\[RANDOMFAGGOTS\]/[Randomfaggots]/i; |
68 $newname =~ s/\[Keroro\]\.(\d+)\.\[Xvid\.mp3\]\./[Keroro] Keroro Gunsou - $1 /i; | 74 $newname =~ s/\[Keroro\]\.(\d+)\.\[Xvid\.mp3\]\./[Keroro] Keroro Gunsou - $1 /i; |
69 $newname =~ s/\[Keroro\] \.(\d+)\. \[\.mp3\] \. /[Keroro] Keroro Gunsou - $1 /i; | 75 $newname =~ s/\[Keroro\] \.(\d+)\. \[\.mp3\] \. /[Keroro] Keroro Gunsou - $1 /i; |
70 $newname =~ s/\[WPP & T-N\]/[WPP T-N]/; | 76 $newname =~ s/\[WPP & T-N\]/[WPP T-N]/; |
71 $newname =~ s/(\[Jumonji-Giri\]) *\[[A-Z0-9- ]+\]/$1/i; | 77 $newname =~ s/(\[Jumonji-Giri\]) *\[[^]]+\]/$1/i; |
72 $newname =~ s/ Yuru Yuri / YuruYuri /i; | 78 $newname =~ s/ Yuru Yuri / YuruYuri /i; |
73 $newname =~ s/ Clannad - After Story / Clannad After Story /i; | 79 $newname =~ s/ Clannad - After Story / Clannad After Story /i; |
74 $newname =~ s/ Manyuu Hikenchou - (\d+) ~DC~ / Manyuu Hikenchou - $1 [Uncut]/; | 80 $newname =~ s/ Manyuu Hikenchou - (\d+) ~DC~ / Manyuu Hikenchou - $1 [Uncut]/; |
75 $newname =~ s/\[Elysium\]K-ON!!\.EP(\d+)\(BD\.1080p\.FLAC\)/[Elysium] K-ON!! - $1 [1080p BD]/i; | 81 $newname =~ s/\[Elysium\]K-ON!!\.EP(\d+)\(BD\.1080p\.FLAC\)/[Elysium] K-ON!! - $1 [1080p BD]/i; |
76 $newname =~ s/\[Elysium\]K-ON!!\.(ED|OP)(\d+)\(BD\.1080p\.FLAC\)/[Elysium] K-ON!! - $1 $2 [1080p BD]/i; | 82 $newname =~ s/\[Elysium\]K-ON!!\.(ED|OP)(\d+)\(BD\.1080p\.FLAC\)/[Elysium] K-ON!! - $1 $2 [1080p BD]/i; |
267 $newname =~ s/ (\d+-\d+) / - $1 /; | 273 $newname =~ s/ (\d+-\d+) / - $1 /; |
268 $newname =~ s/ - - / - /g; | 274 $newname =~ s/ - - / - /g; |
269 $newname =~ s/ Ep / /ig; | 275 $newname =~ s/ Ep / /ig; |
270 ##SLICED BREAD | 276 ##SLICED BREAD |
271 $newname =~ s/(\(|\[) *(10bit-v2) *(\)|\])/[v2]/i; | 277 $newname =~ s/(\(|\[) *(10bit-v2) *(\)|\])/[v2]/i; |
272 $newname =~ s/(\(|\[) *(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; | 278 $newname =~ s/(\(|\[) *(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; |
273 $newname =~ s/\[(DVD 10bit)\]/[DVD]/i; | 279 $newname =~ s/\[(DVD 10bit)\]/[DVD]/i; |
274 $newname =~ s/(\(|\[) *(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; | 280 $newname =~ s/(\(|\[) *(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; |
275 $newname =~ s/(\(|\[) *(BD\]\[1080p-FLAC|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; | 281 $newname =~ s/(\(|\[) *(BD\]\[1080p-FLAC|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; |
276 $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; | 282 $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; |
277 $newname =~ s/(\(|\[) *(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; | 283 $newname =~ s/(\(|\[) *(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; |
433 $newname =~ s/ Opening - / Opening /; | 439 $newname =~ s/ Opening - / Opening /; |
434 $newname =~ s/ Ending - / Ending /; | 440 $newname =~ s/ Ending - / Ending /; |
435 $newname =~ s/ Hidamari Sketch Hoshimittsu - Special / Hidamari Sketch Hoshimittsu Special - /; | 441 $newname =~ s/ Hidamari Sketch Hoshimittsu - Special / Hidamari Sketch Hoshimittsu Special - /; |
436 $newname =~ s/ Spice and Wolf S2 - BD Menu - 0/ Spice and Wolf S2 - BD Menu /; | 442 $newname =~ s/ Spice and Wolf S2 - BD Menu - 0/ Spice and Wolf S2 - BD Menu /; |
437 $newname =~ s/ Canvas - 2 - / Canvas 2 - /; | 443 $newname =~ s/ Canvas - 2 - / Canvas 2 - /; |
444 $newname =~ s/ To Heart - 2 / To Heart 2 /; | |
438 $newname =~ s/ Tsubasa Chronicles - 2 (\d{2}) / Tsubasa Chronicles 2 - $1 /; | 445 $newname =~ s/ Tsubasa Chronicles - 2 (\d{2}) / Tsubasa Chronicles 2 - $1 /; |
439 $newname =~ s/ Mitsudomoe - 2 - / Mitsudomoe 2 - /; | 446 $newname =~ s/ Mitsudomoe - 2 - / Mitsudomoe 2 - /; |
440 $newname =~ s/ Morita-san wa Mukuchi - 2 / Morita-san wa Mukuchi 2 /i; | 447 $newname =~ s/ Morita-san wa Mukuchi - 2 / Morita-san wa Mukuchi 2 /i; |
441 $newname =~ s/ Eyeshield - 21 - / Eyeshield 21 - /; | 448 $newname =~ s/ Eyeshield - 21 - / Eyeshield 21 - /; |
442 $newname =~ s/ - opening - (\d+) / - Opening $1 /i; | 449 $newname =~ s/ - opening - (\d+) / - Opening $1 /i; |
453 $newname =~ s/ +/ /g; | 460 $newname =~ s/ +/ /g; |
454 $newname =~ s/^ +//; | 461 $newname =~ s/^ +//; |
455 $newname =~ s/(- )+/- /; | 462 $newname =~ s/(- )+/- /; |
456 $newname =~ s/^\[N - F\]/[N-F]/; | 463 $newname =~ s/^\[N - F\]/[N-F]/; |
457 $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/; | 464 $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/; |
458 $newname =~ s/^\[([\.\s\w\- ]+)\] (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]/; | 465 $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]/; |
459 $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /; | 466 $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /; |
467 $newname =~ s/^Fairy Tail - (\d{2}) /Fairy Tail - 0$1 /; | |
460 $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /; | 468 $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /; |
469 if ($^O eq "MSWin32") { $newname =~ s/ *\\ */\\/g; } | |
461 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname; | 470 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname; |
462 if ($_ eq $newname) { | 471 if ($_ eq $newname) { |
463 print("$_: no need to rename, skipping\n"); | 472 print("$_: no need to rename, skipping\n"); |
464 } else { | 473 } else { |
465 if($skip==1) { print("Result: $_ --> $newname\n"); } | 474 if($skip==1) { print("Result: $_ --> $newname\n"); } |