Mercurial > ec-dotfiles
annotate bin/ren @ 21:8fa64e01b85b
Merge
author | Edho Prima Arief <me@myconan.net> |
---|---|
date | Wed, 08 Dec 2010 09:09:45 +0700 |
parents | b975a587f8f6 |
children | 3bcef95c376c |
rev | line source |
---|---|
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
1 #!/usr/bin/env perl |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
2 |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
3 use warnings; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
4 use strict; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
5 use File::Basename; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
6 |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
7 my @files = @ARGV or print("Usage: ",basename($0)," file1 ... fileN\n") && exit(1); |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
8 my $skip=0; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
9 foreach (@files) { |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
10 my $newname = $_; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
11 print(qq(Could not find file "$_", skipping\n)) and next() unless -e $_; |
11 | 12 $newname =~ s/ \'[^']+\'//; |
13 #$newname =~ s/ Kiss x Sis OVA / Kiss x Sis OAD /; | |
14 $newname =~ s/x264//; | |
19
b975a587f8f6
Commented insane zero-remover from renamer.
Edho Prima Arief <me@myconan.net>
parents:
11
diff
changeset
|
15 #$newname =~ s/ - 0/ - /; |
11 | 16 $newname =~ s/\[HorribleSubs\] Lilpri /[HorribleSubs] Hime Chen! Otogi Chikku Idol Lilpri - /i; |
17 $newname =~ s/\[HorribleSubs\] Uraboku /[HorribleSubs] Uragiri wa Boku no Namae wo Shitteiru - /i; | |
18 $newname =~ s/ GIG E/ GIG - /; | |
19 $newname =~ s/^Kidou_Keisatsu_Patlabor_\(1990\)_-_([[:digit:]]+)\[16\]_-_.+_\[640x480\]\[DVD\]\[A-Et\]\[([[:xdigit:]]{8})\]\.(mkv)$/[A-Et] Patlabor (1990) - $1 [DVD][${2}].$3/; | |
20 $newname =~ s/^Witchblade_-_([[:digit:]]+)\[24\]_-_.+\[(Makoto|AniSubs)\]\[([[:xdigit:]]{8})\]\.(mkv)$/[$2] Witchblade - $1 [DVD][${3}].$4/; | |
21 $newname =~ s/^Witchblade - ([[:digit:]]+) \[24\] - .+\[(Makoto|AniSubs)\]\[([[:xdigit:]]{8})\]\[v2\]\.(mkv)$/[$2] Witchblade - $1 [DVD][v2][${3}].$4/; | |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
22 $newname =~ s/Sakura\.Wars\.([[:digit:]]{2}).*/[AM] Sakura Wars - $1.mkv/; |
11 | 23 $newname =~ s/^Black Lagoon Omake /[OCZ] Black Lagoon - Special /; |
24 $newname =~ s/_AIR_/ Air /; | |
25 $newname =~ s/\(b-a\)/[B-A] /i; | |
26 #$newname =~ s/ ([[:digit:]]{2}) / 0$1 /; | |
27 #$newname =~ s/^Feather #([[:digit:]]{2}) .*(\.mkv)$/[DmonHiro] Sekirei - $1$2/; | |
28 #$newname =~ s/(Galaxy Angel)/$1 S3 - /; | |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
29 #$newname =~ s/Legend Of The Crystals OAV - 0/- Legend of the Crystals OVA - /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
30 #$newname =~ s/^Kaleido_Star_-_([[:digit:]]{2}).*(\[[[:xdigit:]]{8}\]\.mkv)$/[joseole99] Kaleido Star - $1 [DVD]$2/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
31 #$newname =~ s/^Kaleido_Star_-_Clean_ED([[:digit:]]).*(\[[[:xdigit:]]{8}\]\.mkv)$/[joseole99] Kaleido Star - Ending $1 (Clean) [DVD]$2/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
32 #$newname =~ s/^Kaleido_Star_-_Clean_OP([[:digit:]]).*(\[[[:xdigit:]]{8}\]\.mkv)$/[joseole99] Kaleido Star - Opening $1 (Clean) [DVD]$2/i; |
11 | 33 #$newname =~ s/^Kidou Keisatsu Patlabor \(1989\) - ([[:digit:]]{2}) \[47\].*(\[[[:xdigit:]]{8}\])v2(\.[^.]+)$/[AM] Patlabor (1989) - $1 [DVD][v2] $2$3/i; |
34 #$newname =~ s/.*_-_([[:digit:]]{2})\[26\].*(\[[[:xdigit:]]{8}\]\.avi)$/[Triad] Akagi - $1 $2/i; | |
35 #$newname =~ s/^.*\.([[:digit:]]{2})\..*\.mkv$/[AM] Neo Ranga - $1.mkv/; | |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
36 #$newname =~ s/.* ([[:digit:]]+) .*/[AonE-AnY] Ah My Goddess - $1.avi/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
37 #$newname =~ s/\[24-\(Final\)\]_/24 [End]/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
38 #$newname =~ s/\[([[:digit:]]{2})\]/$1/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
39 #$newname =~ s/^Otaku no Musume-san c([[:digit:]]+) \[v03\](\[.+\])\.zip$/Otaku no Musume-san - $1 (v03) $2.zip/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
40 #$newname =~ s/ HQ //; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
41 $newname =~ s/xvid//i; |
11 | 42 $newname =~ s/\(-mp3\)//; |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
43 $newname =~ s/^\[Doremi\]\.HeartCatch\.PreCure!\.([[:digit:]]{2})\.\[1280x720\]\.\[([[:xdigit:]]{8})\]\.mkv$/[Doremi] HeartCatch PreCure! - $1 (1280x720) [$2].mkv/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
44 $newname =~ s/^\[Doremi\]\.Motto\.Ojamajo\.Doremi\.([[:digit:]]{2})\.\[([[:xdigit:]]{8})\]\.avi$/[Doremi] Motto Ojamajo Doremi - $1 [$2].avi/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
45 $newname =~ s/^(Detective Conan - [[:digit:]]+-?[[:digit:]]*) (\[DCTP[^]]*\])(.+)$/$2 $1 $3/; |
11 | 46 $newname =~ s/^(Detective Conan - [[:digit:]]+-?[[:digit:]]*) (\[Kienai[^]]*\])(.+)$/$2 $1 $3/; |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
47 $newname =~ s/^(Detective Conan - OVA[[:digit:]]+-?[[:digit:]]*) (\[DCTP[^]]*\])(.+)$/$2 $1 $3/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
48 $newname =~ s/^(Kamen Rider W - [[:digit:]]+)HD (\[W-Time\])(.+)$/$2 $1 $3/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
49 $newname =~ s/- TV -/-/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
50 $newname =~ s/^(\[Keroro\])\.([[:digit:]]+)\..*(\[[[:xdigit:]]{8}\].+)$/$1 Keroro Gunsou - $2 $3/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
51 $newname =~ s/SubDESU(.*)_-_Directors_Cut/SubDesu$1/; |
11 | 52 $newname =~ s/\[(480p|360p)\]//; |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
53 $newname =~ s/^(\[EG\])ZZ_Gundam_BD_([[:digit:]]+)\(720p\)(.+)$/$1 Gundam ZZ - $2 (960x720) [BD]$3/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
54 $newname =~ s/\]_Working_-/] Working!! -/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
55 $newname =~ s/WORKING!!/Working!!/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
56 $newname =~ s/\[Retrofit\]_\[Ayako-m\.3\.3\.w\.\]/[Retrofit-Ayako-m.3.3.w]/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
57 $newname =~ s/Rosario\+Vampire/Rosario + Vampire/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
58 $newname =~ s/Rosario \+ Vampire - Capu2 - /Rosario + Vampire Capu 2 - /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
59 $newname =~ s/ Hidamari Sketch Hoshimittsu / Hidamari Sketch - Hoshi Mittsu /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
60 $newname =~ s/ HEROMAN / Heroman /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
61 #$newname =~ s/^/[ETB]/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
62 $newname =~ s/_/ /g; |
11 | 63 $newname =~ s/ asobi ni ikuyo / Asobi ni Iku Yo! /i; |
64 $newname =~ s/ Eve no Jikan / Time of Eve /i; | |
65 $newname =~ s/ DVD +\[/ [DVD][/i; | |
66 $newname =~ s/^(.+)\[(Z-Z)\](.+)$/[$2] $1 $3/; | |
67 $newname =~ s/\[62\] - .*\[DVD\]/[DVD]/; | |
68 $newname =~ s/S0/Special /; | |
69 $newname =~ s/\(1080p\)/(1920x1080)/; | |
70 $newname =~ s/ Seikimatsu Occult Gakuin / Occult Academy /; | |
71 $newname =~ s/ rockman exe axess / Rockman.EXE Axess /i; | |
72 $newname =~ s/\[& MP3\]//; | |
73 $newname =~ s/\[AAC\]//; | |
74 $newname =~ s/ DVD \[/[DVD][/i; | |
75 $newname =~ s/\[720 \(853\)x480\]\[x264 & HE-AAC\]//; | |
76 $newname =~ s/ Ep - ([[:digit:]]+) / - $1 /; | |
77 $newname =~ s/ Asobi ni Ikuyo! / Asobi ni Iku Yo! /i; | |
78 $newname =~ s/ \(Directors Cut\) / /; | |
79 $newname =~ s/ KimiKiss Pure Rouge / kimikiss pure rouge /i; | |
80 $newname =~ s/ HIGHSCHOOL OF THE DEAD / High School of the Dead /i; | |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
81 $newname =~ s/ ARIA The ORIGINATION / Aria the Origination /i; |
11 | 82 $newname =~ s/ Shinseiki Evangelion / Evangelion /; |
83 $newname =~ s/ Kuro no Keiyakusha / The Black Contractor /i; | |
84 $newname =~ s/ Darker than Black / Darker than Black /i; | |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
85 $newname =~ s/ ARIA The NATURAL / Aria the Natural /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
86 $newname =~ s/^Clannad Ep([[:digit:]]+) \[1080p,BluRay,x264\] - THORA\.mkv$/[THORA] Clannad - $1 (1920x1080) [BD].mkv/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
87 $newname =~ s/ Mahou Kishi Rayearth / Magic Knight Rayearth /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
88 $newname =~ s/rune soldier ep/ Rune Soldier /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
89 $newname =~ s/ Harukanaru Toki no Naka de Hachiyoushou / Haruka Naru Toki no Naka de - Hachiyoushou /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
90 $newname =~ s/ Harukanaru Toki no Naka de - / Haruka Naru Toki no Naka de - Hachiyoushou /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
91 $newname =~ s/ -Hachiyoushou - / - Hachiyoushou - /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
92 $newname =~ s/\[Retrofit\] \[Shinsen\] /[Retrofit-SHS] /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
93 $newname =~ s/ You're Under Arrest - / You're Under Arrest! - /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
94 $newname =~ s/ Rosario to Vampire / Rosario + Vampire /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
95 $newname =~ s/\[R2 Video\]//i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
96 $newname =~ s/ \(BD-720p\) \[/ (1280x720) [BD][/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
97 $newname =~ s/ TV Ep/ - /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
98 $newname =~ s/\] AIR - /] Air - /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
99 $newname =~ s/ - Episode / - /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
100 $newname =~ s/\[divx[[:digit:].]+\]//i; |
11 | 101 $newname =~ s/\[BD\] \((1280x720|1920x1080)\) \[/($1) [BD][/i; |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
102 $newname =~ s/ Seiken no Blacksmith / The Sacred Blacksmith /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
103 #$newname =~ s/^Rizelmine([[:digit:]]+)\.avi$/[AC] Rizelmine - $1.avi/i; |
11 | 104 #$newname =~ s/\[v2\]/v2/i; |
105 $newname =~ s/v2/[v2]/i; | |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
106 $newname =~ s/\.AAC\]//; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
107 $newname =~ s/ No / no /g; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
108 #$newname =~ s/ 0([[:digit:]]) / $1 /; |
11 | 109 $newname =~ s/\[(1280x720|1024x576)\]/($1) /; |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
110 #$newname =~ s/^.*( [[:digit:]]{2}v2).*(\[[[:xdigit:]]{8}\]\.mkv)$/[KAA] Ai Yori Aoshi - $1 [DVD]$2/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
111 $newname =~ s/ True Tears / true tears /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
112 $newname =~ s/ Fate stay night TV Reproduction / Fate-stay night - TV Reproduction /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
113 $newname =~ s/ The Tatami Galaxy \(Yojouhan Shinwa Taikei\) / The Tatami Galaxy /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
114 $newname =~ s/ Saint Seiya The Lost Canvas / Saint Seiya - The Lost Canvas /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
115 $newname =~ s/Mayoi Neko Overrun /Mayoi Neko Overrun! /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
116 $newname =~ s/Angel Beats /Angel Beats! /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
117 $newname =~ s/Rainbow /Rainbow /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
118 $newname =~ s/ Ookiku Furikabutte - The Summer Tournament Chapter / Ookiku Furikabutte S2 /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
119 $newname =~ s/Senko no night raid /Senkou no Night Raid /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
120 $newname =~ s/To Heart Mini Ep0/To Heart - Special /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
121 $newname =~ s/Mai Otome/Mai-Otome/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
122 $newname =~ s/WORKING!!/Working!!/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
123 $newname =~ s/ Sengoku Basara / Sengoku Basara /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
124 $newname =~ s/ K-on!! S2 / K-ON!! /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
125 #$newname =~ s/.*\[([[:digit:]]{2})\].*(\[[[:xdigit:]]{8}\]\.mkv)/[FuktLogik] Hidamari Sketch - $1 [DVD]$2/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
126 $newname =~ s/\(BD\) \[/ [BD][/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
127 $newname =~ s/\[\[BD\]/[BD][/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
128 $newname =~ s/\(DVD \)/[DVD]/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
129 $newname =~ s/ AC3\]/ /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
130 $newname =~ s/ *(\.[[:alnum:]]+)[^[:alnum:]]*$/$1/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
131 $newname =~ s/\[webrip\]/[Webrip]/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
132 $newname =~ s/\[[^]]*(640x360|[[:digit:]]{3}x480)[^]]*\]//; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
133 $newname =~ s/([^]])\[/$1 [/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
134 #$newname =~ s/- .*x264 AAC\)//; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
135 #$newname =~ s/ 0([[:digit:]]) / $1 /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
136 #$newname =~ s/ - Great Guardians OVA - / Great Guardians - Special - /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
137 #$newname =~ s/ ([\d]) / 0$1 /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
138 #$newname =~ s/.* ([\d]{2}) .*/[HL] Gundam ZZ - $1.mkv/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
139 #$newname =~ s/ \[[[:xdigit:]]{8}\]//; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
140 $newname =~ s/^\(([^)]+)\)/[$1]/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
141 $newname =~ s/sonic x/Sonic X/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
142 $newname =~ s/END/End/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
143 #$newname =~ s/\[[^]]*h\.?264[^]]*\]//; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
144 $newname =~ s/h\.?264//i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
145 $newname =~ s/ op([\d]) / Opening $1 /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
146 $newname =~ s/ ed([\d]) / Ending $1 /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
147 $newname =~ s/ dragonball / Dragon Ball /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
148 $newname =~ s/Kissxsis/ Kiss x Sis /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
149 $newname =~ s/k-on/K-ON/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
150 #$newname =~ s/ dvd (\(.*\) )?\[/ $1 [DVD][/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
151 $newname =~ s/ ([\d]+)( |\.)/ - $1$2/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
152 $newname =~ s/\(([[:xdigit:]]{8})\)/[$1]/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
153 $newname =~ s/ ep([\d]+) / - $1 /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
154 $newname =~ s/- \[/ [/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
155 $newname =~ s/&/ & /g; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
156 $newname =~ s/ ([\d]{2})\[/ $1 [/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
157 $newname =~ s/(\[[0-9a-fA-F]{8})/\U$1/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
158 $newname =~ s/v([[:digit:].]+)([^\[]+)\[/${2}[v${1}][/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
159 #$newname =~ s/v2 (?=\(.*\) ) \[/ $1 [v2][/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
160 $newname =~ s/([^ ])\[DVD\]\[x264\.AAC\]/$1 [DVD]/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
161 $newname =~ s/\(DVD\) +\[/[DVD][/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
162 $newname =~ s/^(\[[^]]+\])([^ ])/$1 $2/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
163 $newname =~ s/(\((1280x720|960x720)[^)]*\))/($2)/; |
11 | 164 #$newname =~ s/(\((1920x1080)[^)]*\)) /($2) [BD]/; |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
165 $newname =~ s/\[[^]]*720p[^]]*\] ?/(1280x720) /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
166 $newname =~ s/\[[^]]*1080p[^]]*\] ?/(1920x1080) /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
167 $newname =~ s/\(720p\)/(1280x720)/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
168 $newname =~ s/\[1280x720[^]]+\]/ (1280x720) /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
169 $newname =~ s/\([^)]*704x480[^)]*\)//; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
170 $newname =~ s/([^ ])\(/$1 (/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
171 $newname =~ s/\.avi\.avi/.avi/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
172 $newname =~ s/^\[([^]&\-]*) +& +([^]&\-]*)\]/[$1-$2]/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
173 $newname =~ s/\(704x396 x264 AAC\)//; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
174 $newname =~ s/\] +\[/][/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
175 $newname =~ s/~([^~]+)~/- $1 /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
176 $newname =~ s/\[DVD[^]]+\]/[DVD]/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
177 $newname =~ s/(\[BD\])+/[BD]/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
178 #$newname =~ s/Ep //; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
179 $newname =~ s/([[:digit:]])v([[:digit:]]) \[/$1 [v$2][/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
180 $newname =~ s/([^-]) ([0-9]{2,3}) /$1 - $2 /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
181 $newname =~ s/- *\[/ [/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
182 $newname =~ s/( ?- )+/ - /g; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
183 #$newname =~ s/ Special - / Special /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
184 $newname =~ s/ (\)|\])/$1/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
185 $newname =~ s/(\(|\[) /$1/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
186 $newname =~ s/(\(\)|\[\])+//; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
187 #$newname =~ s/\) +\[/) [BD][/; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
188 #$newname =~ s/SP/- Special /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
189 $newname =~ s/\[(Final|End)\]/[End]/i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
190 #$newname =~ s/Gurren Lagann Parallel Works - 2/Gurren Lagann Parallel Works 2/; |
11 | 191 $newname =~ s/ - special - ([[:digit:]]+)( |\.)/ - Special $1$2/i; |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
192 $newname =~ s/ memories off - 3\.5 - / Memories Off 3.5 - /i; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
193 $newname =~ s/ - Navigation - / - Navigation /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
194 $newname =~ s/ - Picture Drama - / - Picture Drama /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
195 $newname =~ s/\[W B\]/[W_B]/; |
11 | 196 $newname =~ s/ OP / - Opening /; |
197 $newname =~ s/ ED / - Ending /; | |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
198 $newname =~ s/ - (Ending|Opening) - 1 / - $1 /; |
11 | 199 $newname =~ s/ (Ending|Opening) - / - $1 /; |
200 $newname =~ s/ Strike Witches - 2 - / Strike Witches 2 - /; | |
201 $newname =~ s/ Macross - 7 - / Macross 7 - /; | |
202 $newname =~ s/ Samurai - 7 - / Samurai 7 - /; | |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
203 $newname =~ s/Seed Character Theater - /SEED - Character Theater /; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
204 $newname =~ s/ - (Ending|Opening) - ([[:digit:]]+) / - $1 $2 /; |
11 | 205 $newname =~ s/ Captain Tsubasa Road to - 2002 - / Captain Tsubasa Road to 2002 - /i; |
206 $newname =~ s/ Golgo - 13 - / Golgo 13 - /i; | |
207 $newname =~ s/\]v3\./][v3]./; | |
208 $newname =~ s/^(.+)(\[v2\])(.+)$/$2 $1 $3/; | |
209 $newname =~ s/^(.+)(\[v3\])(.+)$/$2 $1 $3/; | |
210 $newname =~ s/(\[v2\]) (.+) (\[.+)/$2 ${1}$3/; | |
211 $newname =~ s/(\[v3\]) (.+) (\[.+)/$2 ${1}$3/; | |
212 $newname =~ s/\) \./)./; | |
213 $newname =~ s/\[+/[/g; | |
214 $newname =~ s/\]+/]/g; | |
215 $newname =~ s/( ?- )+/ - /g; | |
216 $newname =~ s/\[+ *\]+//g; | |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
217 $newname =~ s/ +/ /g; |
11 | 218 $newname =~ s/ VS Knight Lamune & - 40 fire / VS Knight Lamune & 40 fire /; |
4
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
219 print(qq($_: $newname already exists, skipping\n)) and next() if -e $newname and $_ ne $newname; |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
220 if ($_ eq $newname) { |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
221 print("$_: no need to rename, skipping\n"); |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
222 } else { |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
223 if($skip==1) { print("Result: $_ --> $newname\n"); } |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
224 else { |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
225 if(rename($_, $newname)) { print("$_ -> $newname\n"); } |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
226 else { print("$_: rename failed\n"); } |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
227 } |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
228 } |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
229 next(); |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
230 } |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
231 |
94ee419ad047
Added bin-ec - a collection of scripts.
Edho Prima Arief <me@myconan.net>
parents:
diff
changeset
|
232 exit(0); |