Mercurial > ec-dotfiles
comparison bin/ren @ 85:14435bd3f01c
Various rules.
author | Edho Prima Arief <me@myconan.net> |
---|---|
date | Sat, 09 Jul 2011 15:35:04 +0700 |
parents | 34f193d5e7cd |
children | 4a22703b183c |
comparison
equal
deleted
inserted
replaced
84:34f193d5e7cd | 85:14435bd3f01c |
---|---|
18 $newname =~ s/\[Elysium\]K-ON!!\.SP\d+\[EP(\d+)\]\(BD\.1080p\.FLAC\)/[Elysium] K-ON!! - $1 [1080p BD]/i; | 18 $newname =~ s/\[Elysium\]K-ON!!\.SP\d+\[EP(\d+)\]\(BD\.1080p\.FLAC\)/[Elysium] K-ON!! - $1 [1080p BD]/i; |
19 $newname =~ s/^\[wpp\]digimon frontier /[wpp] Digimon Frontier /i; | 19 $newname =~ s/^\[wpp\]digimon frontier /[wpp] Digimon Frontier /i; |
20 $newname =~ s/^\[ACX\]Fantastic Children - (\d+) .*/[ACX] Fantastic Children - $1.mkv/i; | 20 $newname =~ s/^\[ACX\]Fantastic Children - (\d+) .*/[ACX] Fantastic Children - $1.mkv/i; |
21 $newname =~ s/\[a-s\] sakigake!! cromartie high school - (\d+) - .* /[a-S] Sakigake!! Cromartie High School - $1 /; | 21 $newname =~ s/\[a-s\] sakigake!! cromartie high school - (\d+) - .* /[a-S] Sakigake!! Cromartie High School - $1 /; |
22 $newname =~ s/zx\.tenchi-universe\./[zx] Tenchi Universe - /; | 22 $newname =~ s/zx\.tenchi-universe\./[zx] Tenchi Universe - /; |
23 $newname =~ s/\[Saizen & Shinsen-Subs\]/[Saizen-SHS]/i; | |
23 $newname =~ s/ ro-kyu-bu! / Ro-Kyu-Bu! /i; | 24 $newname =~ s/ ro-kyu-bu! / Ro-Kyu-Bu! /i; |
25 $newname =~ s/ Ore no Imouto ga Konna ni Kawaii Wake ga Nai / Ore no Imouto /i; | |
26 $newname =~ s/ no 6 / No. 6 /i; | |
27 $newname =~ s/ THE iDOLM\@STER / The iDOLM\@STER /i; | |
28 $newname =~ s/^- (\d+) - (\[neo1024\])/$2 Luping III S3 - $2/i; | |
29 $newname =~ s/ Luping III S3 / Lupin III S3 /i; | |
24 $newname =~ s/( Transformers Headmasters - \d+) - .*\[/$1 [/i; | 30 $newname =~ s/( Transformers Headmasters - \d+) - .*\[/$1 [/i; |
25 $newname =~ s/^cor\.tv\.getbackers\.(\d+)\./[cor] GetBackers - $1 /; | 31 $newname =~ s/^cor\.tv\.getbackers\.(\d+)\./[cor] GetBackers - $1 /; |
26 $newname =~ s/^cor\.extras\.getbackers\.(opening|ending)(\d+)\./[cor] GetBackers - $1 $2 /; | 32 $newname =~ s/^cor\.extras\.getbackers\.(opening|ending)(\d+)\./[cor] GetBackers - $1 $2 /; |
27 $newname =~ s/^Revolutionary Girl Utena /[Henshin] Revolutionary Girl Utena /; | 33 $newname =~ s/^Revolutionary Girl Utena /[Henshin] Revolutionary Girl Utena /; |
28 $newname =~ s/His and Her Circumstances/His and Her Circumstances/i; | 34 $newname =~ s/His and Her Circumstances/His and Her Circumstances/i; |
35 $newname =~ s/Magical Girl Madoka Magica/Puella Magi Madoka Magica/i; | |
36 $newname =~ s/ Pretty Rhythm Aurora Dream / Pretty Rhythm - Aurora Dream /i; | |
29 $newname =~ s/(\[dvdrip\] Transformers \(1984\) -) E(\d+) .*(\.avi)/$1 $2 $3/; | 37 $newname =~ s/(\[dvdrip\] Transformers \(1984\) -) E(\d+) .*(\.avi)/$1 $2 $3/; |
30 $newname =~ s/ Highschool of the Dead / High School of the Dead /i; | 38 $newname =~ s/ Highschool of the Dead / High School of the Dead /i; |
31 $newname =~ s/LOGH Gaiden 2 E(\d+) .*(\.avi|\.mkv)/Legend of Galactic Heroes Gaiden 2 - $1$2/i; | 39 $newname =~ s/LOGH Gaiden 2 E(\d+) .*(\.avi|\.mkv)/Legend of Galactic Heroes Gaiden 2 - $1$2/i; |
32 $newname =~ s/^\[RaX\] *Kiba - (\d+) - .* (\[v2\] \[|\[)/[RaX] Kiba - $1 $2/; | 40 $newname =~ s/^\[RaX\] *Kiba - (\d+) - .* (\[v2\] \[|\[)/[RaX] Kiba - $1 $2/; |
33 $newname =~ s/ (Gosick - \d+) \(Batch\) / $1 /; | 41 $newname =~ s/ (Gosick - \d+) \(Batch\) / $1 /; |
34 $newname =~ s/ Clannad - After Story - / Clannad After Story - /; | 42 $newname =~ s/ Clannad - After Story - / Clannad After Story - /; |
35 $newname =~ s/^Mahoujin Guruguru TV2 - Doki Doki Densetsu Ep(\d+) \((Chamelenia)\)/[Chamelenia] Mahoujin Guruguru 2 - Doki Doki Densetsu - $1/i; | 43 $newname =~ s/^Mahoujin Guruguru TV2 - Doki Doki Densetsu Ep(\d+) \((Chamelenia)\)/[Chamelenia] Mahoujin Guruguru 2 - Doki Doki Densetsu - $1/i; |
36 $newname =~ s/\.divx5\.ogm$/.ogm/; | 44 $newname =~ s/\.divx5\.ogm$/.ogm/; |
37 $newname =~ s/\[(neo1024)\] Lupin III - (\d+) - .+ \[/[$1] Lupin III S2 - $2 [/; | 45 #$newname =~ s/\[(neo1024)\] Lupin III - (\d+) - .+ \[/[$1] Lupin III S2 - $2 [/; |
38 $newname =~ s/ Lupin S2 - / Lupin III S2 - /; | 46 $newname =~ s/ Lupin S2 - / Lupin III S2 - /; |
39 $newname =~ s/ Prince of Tennis (\d+)/ Prince of Tennis - $1/i; | 47 $newname =~ s/ Prince of Tennis (\d+)/ Prince of Tennis - $1/i; |
40 $newname =~ s/ Boogiepop - / Boogiepop Phantom - /i; | 48 $newname =~ s/ Boogiepop - / Boogiepop Phantom - /i; |
41 $newname =~ s/ Aika Zero OVA / Aika Zero /i; | 49 $newname =~ s/ Aika Zero OVA / Aika Zero /i; |
42 $newname =~ s/^\[A-BT&Pakapuka\]PopoloCrois 2003 Ep/[A-BT Pakapuka] PopoloCrois (2003) - /; | 50 $newname =~ s/^\[A-BT&Pakapuka\]PopoloCrois 2003 Ep/[A-BT Pakapuka] PopoloCrois (2003) - /; |
98 $newname =~ s/\[(BWS|PM)\]Pocket Monsters Best Wishes (\d+) .+\[H264 /[$1] Pokemon Best Wishes - $2 [/; | 106 $newname =~ s/\[(BWS|PM)\]Pocket Monsters Best Wishes (\d+) .+\[H264 /[$1] Pokemon Best Wishes - $2 [/; |
99 $newname =~ s/ Ookiku Furikabutte - The Summer Tournament Chapter / Ookiku Furikabutte S2 /; | 107 $newname =~ s/ Ookiku Furikabutte - The Summer Tournament Chapter / Ookiku Furikabutte S2 /; |
100 $newname =~ s/Les Miserables Shoujo Cosette /Les Miserables /; | 108 $newname =~ s/Les Miserables Shoujo Cosette /Les Miserables /; |
101 $newname =~ s/\[Elysium\]Baka\.to\.Test\.to\.Shoukanjuu\.(EP)?/[Elysium] Baka to Test to Shokanju/; | 109 $newname =~ s/\[Elysium\]Baka\.to\.Test\.to\.Shoukanjuu\.(EP)?/[Elysium] Baka to Test to Shokanju/; |
102 $newname =~ s/\[Elysium\] Baka to Test to Shokanju/[Elysium] Baka to Test to Shokanju /; | 110 $newname =~ s/\[Elysium\] Baka to Test to Shokanju/[Elysium] Baka to Test to Shokanju /; |
103 $newname =~ s/\(BD\.1080p\.FLAC\)/[1080p BD]/; | |
104 $newname =~ s/Saizen & SD/Saizen-SD/; | 111 $newname =~ s/Saizen & SD/Saizen-SD/; |
105 $newname =~ s/Bleach - (\d{2}) /Bleach - 0$1 /; | 112 $newname =~ s/Bleach - (\d{2}) /Bleach - 0$1 /; |
106 $newname =~ s/Omamori Himari - ED \(Clean\) - 0(\d) / Omamori Himari - Ending $1 (Clean) /; | 113 $newname =~ s/Omamori Himari - ED \(Clean\) - 0(\d) / Omamori Himari - Ending $1 (Clean) /; |
107 $newname =~ s/Omamori Himari - Opening \(Clean\) - (\d{2}) / Omamori Himari - Opening $1 (Clean) /; | 114 $newname =~ s/Omamori Himari - Opening \(Clean\) - (\d{2}) / Omamori Himari - Opening $1 (Clean) /; |
108 $newname =~ s/\(B-A\)Great Teacher Onizuka - Lesson /[B-A] Great Teacher Onizuka - /; | 115 $newname =~ s/\(B-A\)Great Teacher Onizuka - Lesson /[B-A] Great Teacher Onizuka - /; |
170 $newname =~ s/ A Certain Magical Index II / Toaru Majutsu no Index II /i; | 177 $newname =~ s/ A Certain Magical Index II / Toaru Majutsu no Index II /i; |
171 $newname =~ s/ TV Broadcast \[720p/ [LQ 720p/; | 178 $newname =~ s/ TV Broadcast \[720p/ [LQ 720p/; |
172 $newname =~ s/ ED(\d)/ - Ending $1 /; | 179 $newname =~ s/ ED(\d)/ - Ending $1 /; |
173 $newname =~ s/ OP(\d)/ - Opening $1 /; | 180 $newname =~ s/ OP(\d)/ - Opening $1 /; |
174 $newname =~ s/ ED / - Ending /; | 181 $newname =~ s/ ED / - Ending /; |
175 $newname =~ s/ NCED / - Ending (Clean) /; | 182 $newname =~ s/ NCED / - Ending (Clean) /i; |
176 $newname =~ s/ NCOP / - Opening (Clean)/; | 183 $newname =~ s/ NCED(\d+) / - Ending $1 (Clean) /i; |
184 $newname =~ s/ NCOP / - Opening (Clean)/i; | |
177 $newname =~ s/ OP / - Opening /; | 185 $newname =~ s/ OP / - Opening /; |
178 $newname =~ s/ - - / - /; | 186 $newname =~ s/ - - / - /; |
179 $newname =~ s/ Ep / /ig; | 187 $newname =~ s/ Ep / /ig; |
180 #GENERAL RULES | 188 #GENERAL RULES |
181 $newname =~ s/\(1280x720 x264 AAC\)/[720p]/i; | 189 $newname =~ s/\(1280x720 x264 AAC\)/[720p]/i; |
182 $newname =~ s/\( *(1920x1080 h264 BD FLAC|1920x1080 BD) *\)/[1080p BD]/i; | 190 $newname =~ s/\( *(1920x1038 Blu-Ray FLAC|1920x1080 h264 BD FLAC|1920x1080 BD) *\)/[1080p BD]/i; |
191 $newname =~ s/\(BD\.1080p\.FLAC\)/[1080p BD]/; | |
183 ##SLICED BREAD | 192 ##SLICED BREAD |
184 $newname =~ s/\[(\d+th Release|xvid|divx5\.2\.1|divx5\.1|divx5\.05|divx5\.1\.1|h\.?264 AC3|848x480|H264 848x480|h264-480p AAC|h\.264-480p)\]//i; | 193 $newname =~ s/\[(\d+th Release|xvid|divx5\.2\.1|divx5\.1|divx5\.05|divx5\.1\.1|h\.?264 AC3|848x480|H264 848x480|h264-480p AAC|h\.264-480p)\]//i; |
185 $newname =~ s/\[(DVD 720x480|DVD H264 720x480)\]/[DVD]/i; | 194 $newname =~ s/\[(DVD 720x480|DVD H264 720x480)\]/[DVD]/i; |
186 $newname =~ s/\[(1280x720 H264 AAC)\]/[720p]/i; | 195 $newname =~ s/\[(1280x720 H264 AAC)\]/[720p]/i; |
187 $newname =~ s/\[(BD 1280x720 H264 AAC)\]/[720p BD]/i; | 196 $newname =~ s/\[(BD 1280x720 H264 AAC)\]/[720p BD]/i; |
197 $newname =~ s/\( *(BD 720p|BD 720p FLAC|BD 1280x720 H264 AAC) *\)/[720p BD]/i; | |
198 $newname =~ s/\( *(1280x720|1280x720 H\.?264 AAC) *\)/[720p]/i; | |
188 ##SLICED BREAD pt.2 | 199 ##SLICED BREAD pt.2 |
189 $newname =~ s/(\d+)v(\d+)/$1 [v$2]/i; | 200 $newname =~ s/(\d+)v(\d+)/$1 [v$2]/i; |
190 $newname =~ s/\[BD\]\[1920x1080 H264-Flac\]/[1080p BD]/i; | 201 $newname =~ s/\[BD\]\[1920x1080 H264-Flac\]/[1080p BD]/i; |
191 $newname =~ s/\.DVD/[DVD]/; | 202 $newname =~ s/\.DVD/[DVD]/; |
192 $newname =~ s/ ~(.+)~ / - $1 /; | 203 $newname =~ s/ ~(.+)~ / - $1 /; |
234 $newname =~ s/ \(960x720\) \[BD\]/ [720p BD]/i; | 245 $newname =~ s/ \(960x720\) \[BD\]/ [720p BD]/i; |
235 $newname =~ s/\(704x396\)//; | 246 $newname =~ s/\(704x396\)//; |
236 $newname =~ s/\(1280x720\)/ [720p]/i; | 247 $newname =~ s/\(1280x720\)/ [720p]/i; |
237 $newname =~ s/\(1920x1080\)/ [1080p]/i; | 248 $newname =~ s/\(1920x1080\)/ [1080p]/i; |
238 $newname =~ s/\(1024x576\)/ [576p]/i; | 249 $newname =~ s/\(1024x576\)/ [576p]/i; |
250 $newname =~ s/\[1024x576\]/[576p]/i; | |
251 $newname =~ s/\[v(\d+) 1024x576\]/[v$1 576p]/i; | |
239 $newname =~ s/\(1280x720 h264\)/ [720p]/i; | 252 $newname =~ s/\(1280x720 h264\)/ [720p]/i; |
240 $newname =~ s/\(1280x720 ?(h264|x264)?( aac)?\)/ [720p]/i; | 253 $newname =~ s/\(1280x720 ?(h264|x264)?( aac)?\)/ [720p]/i; |
241 $newname =~ s/\(720p\)/[720p]/i; | 254 $newname =~ s/\(720p\)/[720p]/i; |
242 $newname =~ s/\(1080p\)/[1080p]/i; | 255 $newname =~ s/\(1080p\)/[1080p]/i; |
243 $newname =~ s/\(1080p,BD\)/[1080p BD]/i; | 256 $newname =~ s/\(1080p,BD\)/[1080p BD]/i; |
348 $newname =~ s/ +/ /g; | 361 $newname =~ s/ +/ /g; |
349 $newname =~ s/^ +//; | 362 $newname =~ s/^ +//; |
350 $newname =~ s/(- )+/- /; | 363 $newname =~ s/(- )+/- /; |
351 $newname =~ s/^\[N - F\]/[N-F]/; | 364 $newname =~ s/^\[N - F\]/[N-F]/; |
352 $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/; | 365 $newname =~ s/^\[K-F & AKUPX\]/[K-F AKUPX]/; |
353 $newname =~ s/^\[([\.\s\w\- ]+)\] (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]/; | 366 $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]/; |
354 $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /; | 367 $newname =~ s/^Naruto - (\d{2}) /Naruto - 0$1 /; |
355 $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /; | 368 $newname =~ s/^Naruto - (\d{2})-(\d{2}) /Naruto - 0$1-0$2 /; |
356 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname; | 369 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname; |
357 if ($_ eq $newname) { | 370 if ($_ eq $newname) { |
358 print("$_: no need to rename, skipping\n"); | 371 print("$_: no need to rename, skipping\n"); |