Mercurial > ec-dotfiles
comparison bin/ren @ 248:fbb03c862b63
Awesome merge.
author | Edho Arief <edho@myconan.net> |
---|---|
date | Tue, 08 Nov 2011 11:59:49 +0700 |
parents | 53b39ca5a6ea f963d52c031a |
children | 1e214a53237d |
comparison
equal
deleted
inserted
replaced
132:53b39ca5a6ea | 248:fbb03c862b63 |
---|---|
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 $newname =~ s/\[t-n\]/[T-N]/i; |
17 #TITLE AND NAMES | 17 #TITLE AND NAMES |
18 $newname =~ s/^(\(|\[)W B(\)|\])/[W_B]/; | 18 $newname =~ s/^(\(|\[)W B(\)|\])/[W_B]/; |
19 if ($newname =~ m/\[Doremi/) { | 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/(\[ACX\])(Spiral)( - \d+) - .* (\[[a-f0-9]{8}\]\.mkv)$/$1 $2$3 $4/i; | 24 $newname =~ s/(\[ACX\])(Spiral)( - \d+) - .* (\[[a-f0-9]{8}\]\.mkv)$/$1 $2$3 $4/i; |
39 $newname =~ s/^Arigatou\.Tokyo\.Majin\.Ep(\d+)\./[Arigatou] Tokyo Majin - $1 /; | 39 $newname =~ s/^Arigatou\.Tokyo\.Majin\.Ep(\d+)\./[Arigatou] Tokyo Majin - $1 /; |
40 $newname =~ s/ (Inazuma Eleven - )(\d{2}) / $1 0$2 /; | 40 $newname =~ s/ (Inazuma Eleven - )(\d{2}) / $1 0$2 /; |
41 $newname =~ s/\] *Pocket Monsters - (\d+) - .*\[(H264 |)SUB\]/] Pokemon - $1 /i; | 41 $newname =~ s/\] *Pocket Monsters - (\d+) - .*\[(H264 |)SUB\]/] Pokemon - $1 /i; |
42 $newname =~ s/\] Fafner - /] Soukyuu no Fafner - /; | 42 $newname =~ s/\] Fafner - /] Soukyuu no Fafner - /; |
43 $newname =~ s/\] Mashiro iro symphony - /] Mashiro-iro Symphony - /i; | 43 $newname =~ s/\] Mashiro iro symphony - /] Mashiro-iro Symphony - /i; |
44 $newname =~ s/\] To Aru Kagaku no Railgun /] Toaru Kagaku no Railgun /i; | |
45 $newname =~ s/\] To Aru Majutsu no Index /] Toaru Majutsu no Index /i; | |
44 $newname =~ s/\] Shakugan no Shana III /] Shakugan no Shana Final /i; | 46 $newname =~ s/\] Shakugan no Shana III /] Shakugan no Shana Final /i; |
45 $newname =~ s/\] Boku Ha Tomodachi Ga Sukunai - /] Boku wa Tomodachi ga Sukunai - /i; | 47 $newname =~ s/\] Boku Ha Tomodachi Ga Sukunai - /] Boku wa Tomodachi ga Sukunai - /i; |
46 $newname =~ s/\] Seikon no Qwaser II BD - (\d+) \[720p\]/] Seikon no Qwaser II - $1 [720p BD]/i; | 48 $newname =~ s/\] Seikon no Qwaser II BD - (\d+) \[720p\]/] Seikon no Qwaser II - $1 [720p BD]/i; |
47 $newname =~ s/\] Seikon no Qwaser Picture Drama - (\d+) /] Seikon no Qwaser - Picture Drama $1 /i; | 49 $newname =~ s/\] Seikon no Qwaser Picture Drama - (\d+) /] Seikon no Qwaser - Picture Drama $1 /i; |
48 $newname =~ s/\] Fortune Arterial Akai Yakusoku - /] Fortune Arterial - /; | 50 $newname =~ s/\] Fortune Arterial Akai Yakusoku - /] Fortune Arterial - /; |
55 $newname =~ s/\] Mayo Chiki - / ] Mayo Chiki! - /i; | 57 $newname =~ s/\] Mayo Chiki - / ] Mayo Chiki! - /i; |
56 $newname =~ s/\] Naruto Shippuden - /] Naruto Shippuuden - /i; | 58 $newname =~ s/\] Naruto Shippuden - /] Naruto Shippuuden - /i; |
57 $newname =~ s/\] Maji de Watashi ni Koi Shinasai!! /] Maji de Watashi ni Koi Shinasai! /i; | 59 $newname =~ s/\] Maji de Watashi ni Koi Shinasai!! /] Maji de Watashi ni Koi Shinasai! /i; |
58 $newname =~ s/\] Sei Juushi Bismarck /] Sei Juushi Bismark /i; | 60 $newname =~ s/\] Sei Juushi Bismarck /] Sei Juushi Bismark /i; |
59 $newname =~ s/\] Tamayura - hitotose - /] Tamayura ~hitotose~ - /i; | 61 $newname =~ s/\] Tamayura - hitotose - /] Tamayura ~hitotose~ - /i; |
62 $newname =~ s/\] Yumekui Merry /] Dream Eater Merry /i; | |
60 $newname =~ s/^Arigatou\.Tsubasa\.Chronicles\.(|2\.)(\d{2})(|v2)\./[Arigatou] Tsubasa Chronicles $1 - $2$3/; | 63 $newname =~ s/^Arigatou\.Tsubasa\.Chronicles\.(|2\.)(\d{2})(|v2)\./[Arigatou] Tsubasa Chronicles $1 - $2$3/; |
61 $newname =~ s/^Niea\.Under\.Seven\.(\d+)\.\(Dual\.Audio\)\.XVID\.\[AM\]/[AM] Niea Under Seven - $1/; | 64 $newname =~ s/^Niea\.Under\.Seven\.(\d+)\.\(Dual\.Audio\)\.XVID\.\[AM\]/[AM] Niea Under Seven - $1/; |
62 $newname =~ s/ Tsubasa Chronicles 2\. - / Tsubasa Chronicles 2 /; | 65 $newname =~ s/ Tsubasa Chronicles 2\. - / Tsubasa Chronicles 2 /; |
63 $newname =~ s/ *Moritasan wa Mukuchi */ Morita-san wa Mukuchi /i; | 66 $newname =~ s/ *Moritasan wa Mukuchi */ Morita-san wa Mukuchi /i; |
64 $newname =~ s/ Hanasakeru Seishonen / Hanasakeru Seishounen /i; | 67 $newname =~ s/ Hanasakeru Seishonen / Hanasakeru Seishounen /i; |
204 $newname =~ s/Natsu no Arashi - Akinai-chuu/Summer Storm! - Open for Business/; | 207 $newname =~ s/Natsu no Arashi - Akinai-chuu/Summer Storm! - Open for Business/; |
205 $newname =~ s/Natsu no Arashi/Summer Storm!/; | 208 $newname =~ s/Natsu no Arashi/Summer Storm!/; |
206 $newname =~ s/Naruto (\d+-\d+) /Naruto - $1 /; | 209 $newname =~ s/Naruto (\d+-\d+) /Naruto - $1 /; |
207 $newname =~ s/Lupin III Series 1 - (\d+) - .+ \[neo1024\]/[neo1024] Lupin III - $1 /; | 210 $newname =~ s/Lupin III Series 1 - (\d+) - .+ \[neo1024\]/[neo1024] Lupin III - $1 /; |
208 $newname =~ s/Mitsudomoe Picture Drama - 0/Mitsudomoe Picture Drama - /; | 211 $newname =~ s/Mitsudomoe Picture Drama - 0/Mitsudomoe Picture Drama - /; |
209 $newname =~ s/^(Star Driver .*)(\[AtsA\])/$2 $1 /i; | 212 $newname =~ s/^(Fullmetal Alchemist Brotherhood .*|Star Driver .*)(\[AtsA\])/$2 $1 /i; |
210 $newname =~ s/(Sora no Woto|Ichiban Ushiro no Daimaou|Mayoi Neko Overrun!) - ([^ ]+|OP Clean|ED Clean|Theater [a-z0-9]+) \[BD 1080p\]\[AtsA\]/[AtsA] $1 - $2 [1080p BD]/; | 213 $newname =~ s/(Sora no Woto|Ichiban Ushiro no Daimaou|Mayoi Neko Overrun!) - ([^ ]+|OP Clean|ED Clean|Theater [a-z0-9]+) \[BD 1080p\]\[AtsA\]/[AtsA] $1 - $2 [1080p BD]/; |
211 $newname =~ s/(Sora no Woto|Ichiban Ushiro no Daimaou|Mayoi Neko Overrun!) ([^ ]+|Opening Clean|Ending Clean|Theater - [a-z0-9]+) \[1080p BD\]\[AtsA\]/[AtsA] $1 - $2 [1080p BD]/; | 214 $newname =~ s/(Sora no Woto|Ichiban Ushiro no Daimaou|Mayoi Neko Overrun!) ([^ ]+|Opening Clean|Ending Clean|Theater - [a-z0-9]+) \[1080p BD\]\[AtsA\]/[AtsA] $1 - $2 [1080p BD]/; |
212 $newname =~ s/Battle\.Programmer\.Shirase\./Battle Programmer Shirase /; | 215 $newname =~ s/Battle\.Programmer\.Shirase\./Battle Programmer Shirase /; |
213 $newname =~ s/Battle Programmer Shirase - 0/Battle Programmer Shirase - /; | 216 $newname =~ s/Battle Programmer Shirase - 0/Battle Programmer Shirase - /; |
214 $newname =~ s/ Kuragehime / Princess Jellyfish /; | 217 $newname =~ s/ Kuragehime / Princess Jellyfish /; |
260 $newname =~ s/ TV Broadcast \[720p/ [LQ 720p/; | 263 $newname =~ s/ TV Broadcast \[720p/ [LQ 720p/; |
261 $newname =~ s/ ED(\d+[a-z]*)/ - Ending $1 /i; | 264 $newname =~ s/ ED(\d+[a-z]*)/ - Ending $1 /i; |
262 $newname =~ s/ OP(\d+[a-z]*)/ - Opening $1 /i; | 265 $newname =~ s/ OP(\d+[a-z]*)/ - Opening $1 /i; |
263 $newname =~ s/ ED / - Ending /; | 266 $newname =~ s/ ED / - Ending /; |
264 $newname =~ s/ Clean (Opening|Ending) v2/ - $1 (Clean) [v2]/i; | 267 $newname =~ s/ Clean (Opening|Ending) v2/ - $1 (Clean) [v2]/i; |
265 $newname =~ s/ Creditless Opening (\d+) / - Opening $1 (Clean) /i; | 268 $newname =~ s/ Creditless (Opening|Ending) (\d+) / - $1 $2 (Clean) /i; |
266 $newname =~ s/ Ep(\d+) Creditless Ending / - Ending $1 (Clean) /i; | 269 $newname =~ s/ Ep(\d+) Creditless Ending / - Ending $1 (Clean) /i; |
267 $newname =~ s/ (NCED|Ending Clean) / - Ending (Clean) /i; | 270 $newname =~ s/ (NCED|Ending Clean) / - Ending (Clean) /i; |
268 $newname =~ s/ NCED(\d+) / - Ending $1 (Clean) /i; | 271 $newname =~ s/ NCED(\d+) / - Ending $1 (Clean) /i; |
269 $newname =~ s/ (NCOP|Opening Clean) / - Opening (Clean)/i; | 272 $newname =~ s/ (NCOP|Opening Clean) / - Opening (Clean)/i; |
270 $newname =~ s/ OP / - Opening /; | 273 $newname =~ s/ OP / - Opening /; |
276 $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; | 279 $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; |
277 $newname =~ s/\[(DVD 10bit)\]/[DVD]/i; | 280 $newname =~ s/\[(DVD 10bit)\]/[DVD]/i; |
278 $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; | 281 $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; |
279 $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; | 282 $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; |
280 $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; | 283 $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; |
281 $newname =~ s/(\(|\[) *(BD 1280x720 H264 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; | 284 $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; |
285 $newname =~ s/(\(|\[) *(BD 540p) *(\)|\])/[BD]/i; | |
282 $newname =~ s/(\(|\[) *(1024x576|H264 1024x576) *(\)|\])/[576p]/i; | 286 $newname =~ s/(\(|\[) *(1024x576|H264 1024x576) *(\)|\])/[576p]/i; |
283 $newname =~ s/(\(|\[) *(1920x1080) *(\)|\])/[1080p]/i; | 287 $newname =~ s/(\(|\[) *(1920x1080) *(\)|\])/[1080p]/i; |
284 ##SLICED BREAD pt.2 | 288 ##SLICED BREAD pt.2 |
285 $newname =~ s/(\d+)v(\d+)/$1 [v$2]/i; | 289 $newname =~ s/(\d+)v(\d+)/$1 [v$2]/i; |
286 $newname =~ s/\[BD\]\[1920x1080 H264-Flac\]/[1080p BD]/i; | 290 $newname =~ s/\[BD\]\[1920x1080 H264-Flac\]/[1080p BD]/i; |
427 $newname =~ s/ Ultraviolet Code - 044 - / Ultraviolet Code 044 - /; | 431 $newname =~ s/ Ultraviolet Code - 044 - / Ultraviolet Code 044 - /; |
428 $newname =~ s/ Persona - 3 Picture Drama - She Goes For A Walk / Persona 3 Picture Drama - She Goes For A Walk - /; | 432 $newname =~ s/ Persona - 3 Picture Drama - She Goes For A Walk / Persona 3 Picture Drama - She Goes For A Walk - /; |
429 $newname =~ s/ SP0/ - Special /; | 433 $newname =~ s/ SP0/ - Special /; |
430 $newname =~ s/ SP(\d+) / - Special $1 /; | 434 $newname =~ s/ SP(\d+) / - Special $1 /; |
431 $newname =~ s/ Special - / - Special /; | 435 $newname =~ s/ Special - / - Special /; |
436 $newname =~ s/ Animated Commentary - / - Animated Commentary /; | |
437 $newname =~ s/ Fullmetal Alchemist Brotherhood (- |)Skit - / Fullmetal Alchemist Brotherhood - Skit /i; | |
432 $newname =~ s/ - Picture Drama - / - Picture Drama /; | 438 $newname =~ s/ - Picture Drama - / - Picture Drama /; |
433 $newname =~ s/ (Mayoi Neko Overrun! - Theater) - / $1 /; | 439 $newname =~ s/ (Mayoi Neko Overrun! - Theater) - / $1 /; |
434 $newname =~ s/ Opening - / Opening /; | 440 $newname =~ s/ Opening - / Opening /; |
435 $newname =~ s/ Ending - / Ending /; | 441 $newname =~ s/ Ending - / Ending /; |
436 $newname =~ s/ Hidamari Sketch Hoshimittsu - Special / Hidamari Sketch Hoshimittsu Special - /; | 442 $newname =~ s/ Hidamari Sketch Hoshimittsu - Special / Hidamari Sketch Hoshimittsu Special - /; |
459 $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/; | 465 $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/; |
460 $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]/; | 466 $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]/; |
461 $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /; | 467 $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /; |
462 $newname =~ s/^Fairy Tail - (\d{2}) /Fairy Tail - 0$1 /; | 468 $newname =~ s/^Fairy Tail - (\d{2}) /Fairy Tail - 0$1 /; |
463 $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /; | 469 $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /; |
470 if ($^O eq "MSWin32") { $newname =~ s/ *\\ */\\/g; } | |
464 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname; | 471 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname; |
465 if ($_ eq $newname) { | 472 if ($_ eq $newname) { |
466 print("$_: no need to rename, skipping\n"); | 473 print("$_: no need to rename, skipping\n"); |
467 } else { | 474 } else { |
468 if($skip==1) { print("Result: $_ --> $newname\n"); } | 475 if($skip==1) { print("Result: $_ --> $newname\n"); } |