This commit is contained in:
olli 2022-07-17 15:07:57 +02:00
parent 1df54ea6e8
commit 734d2e5783
10 changed files with 406 additions and 0 deletions

4
rename-subs/a-zA-Z0-9._ Normal file
View File

@ -0,0 +1,4 @@
s/[^a-zA-Z0-9_\.]/_/g;
s/^\./_/;
s/_+/_/g;

110
rename-subs/asciilower Normal file
View File

@ -0,0 +1,110 @@
# Cyrillic2ascii
s/а/a/g;
s/А/A/g;
s/б/b/g;
s/Б/B/g;
s/в/w/g;
s/В/W/g;
s/г/g/g;
s/Г/G/g;
s/д/d/g;
s/Д/D/g;
s/ье/je/g;
s/ъе/je/g;
s/\sе/je/g;
s/\sЕ/Je/g;
s/е/e/g;
s/Е/E/g;
s/шё/scho/g;
s/жё/sho/g;
s/чё/tscho/g;
s/щё/schtscho/g;
s/ё/jo/g;
s/Ё/Jo/g;
s/ж/sh/g;
s/Ж/Sh/g;
s/з/s/g;
s/З/S/g;
s/ьи/ji/g;
s/ьий/ji/g;
s/ий/i/g;
s/ый/y/g;
s/Й/I/g;
s/и/i/g;
s/И/I/g;
s/й/j/g;
s/Й/J/g;
s/кс/x/g;
s/к/k/g;
s/К/K/g;
s/л/l/g;
s/Л/L/g;
s/м/m/g;
s/М/M/g;
s/н/n/g;
s/Н/N/g;
s/ьо/jo/g;
s/ь/´/g;
s/о/o/g;
s/О/O/g;
s/п/p/g;
s/П/P/g;
s/р/r/g;
s/Р/R/g;
s/с/s/g;
s/С/S/g;
s/т/t/g;
s/Т/T/g;
s/у/u/g;
s/У/U/g;
s/ф/f/g;
s/Ф/F/g;
s/х/ch/g;
s/Х/Ch/g;
s/ц/z/g;
s/Ц/Z/g;
s/ч/tsch/g;
s/Ч/Tsch/g;
s/ш/sch/g;
s/Ш/Sch/g;
s/щ/schtsch/g;
s/Щ/Schtsch/g;
s/ы/y/g;
s/Ы/Y/g;
s/э/e/;
s/Э/e/;
s/ю/ju/g;
s/Ю/Ju/g;
s/я/ja/g;
s/Я/Ja/g;
s/ў/w/g;
s/Ў/W/g;
# German2ascii
s/ö/oe/g;
s/ä/ae/g;
s/ü/ue/g;
s/Ö/Oe/g;
s/Ä/Ae/g;
s/Ü/Ue/g;
s/ß/ss/g;
# spanish2ascii
s/ñ/n/g;
s/é/e/g;
s/í/i/g;
s/ó/o/g;
s/ú/u/g;
s/á/a/g;
# Rest
s/[^a-zA-Z0-9]/_/g;
s/_+/_/g;
# Lower case
$_=lc($_);
# file extension
s/_(...)$/\.$1/;

6
rename-subs/doku_ Normal file
View File

@ -0,0 +1,6 @@
#do "/root/rename-subs/asciilower";
do "/root/rename-subs/nospecial";
#do "/root/rename-subs/a-zA-Z0-9._";
unless (/^Doku /) { $_= "Doku " . $_; }
s/_+/_/g;
s/ +/ /g;

7
rename-subs/film_ Normal file
View File

@ -0,0 +1,7 @@
do "/root/rename-subs/nospecial";
do "/root/rename-subs/videos";
if (/^Serie /) { next; }
unless (/^Film /) { $_= "Film " . $_; }
s/_+/_/g;
s/ +/ /g;

8
rename-subs/musik_ Normal file
View File

@ -0,0 +1,8 @@
do "/root/rename-subs/nospecial";
s/ -- ...........\.mp4$/.mp4/;
unless (/^Musik /) { $_= "Musik " . $_; }
s/_+/_/g;
s/ - / -- /g;
s/ / -- /g;
s/([a-zA-Z0-9])- /$1 -- /g;
s/ +/ /g;

21
rename-subs/nospecial Normal file
View File

@ -0,0 +1,21 @@
s/\(/\[/g;
s/\{/\[/g;
s/\</\[/g;
s/\)/\]/g;
s/\}/\]/g;
s/\>/\]/g;
s/^ +//;
s/ +$//;
s/^\./_/;
s/[\"\`\']/´/g;
s/\\/_/g;
s/\:/_/g;
s/\*/_/g;
s/\?/_/g;
s/\|/_/g;
s/\$/_/g;
s/\#/_/g;
s/\~/_/g;
s/\&/_/g;
s/^-/_/;
s/\.+$//;

5
rename-subs/photos Normal file
View File

@ -0,0 +1,5 @@
s/\.jpeg$/\.jpg/i;
s/\.JPG$/\.jpg/i;
if (-f "$d/$_") {
$_="$_.jpg" unless (/\....$/);
}

10
rename-subs/serie_ Normal file
View File

@ -0,0 +1,10 @@
do "/root/rename-subs/nospecial";
do "/root/rename-subs/videos";
if (/^Film /) { next; }
unless (/^Serie /) { $_= "Serie " . $_; }
s/S([1-9])E([1-9][0-9])/S0$1E$2/;
s/S([1-9])E([1-9])/S0$1E0$2/;
s/ ([0-9]) ([0-9])/ S0$1E0$2/;
s/ S([0-9]) E([0-9])/ S0$1E0$2/;
s/_+/_/g;
s/ +/ /g;

34
rename-subs/the Normal file
View File

@ -0,0 +1,34 @@
if (/^the_/) {
s/^the_//;
s/\./_the./;
}
if (/^der_/) {
s/^der_//;
s/\./_der./;
}
if (/^die_/) {
s/^die_//;
s/\./_die./;
}
if (/^das_/) {
s/^das_//;
s/\./_das./;
}
if (/^The /) {
s/^The //;
s/\./ The./;
}
if (/^Der /) {
s/^Der //;
s/\./ Der./;
}
if (/^Die /) {
s/^Die //;
s/\./ Die./;
}
if (/^Das /) {
s/^Das //;
s/\./ Das./;
}

201
rename-subs/videos Normal file
View File

@ -0,0 +1,201 @@
s/ \! / /g;
s/-id-_[0-9][0-9][0-9][0-9][0-9]_/ /;
s/-id-_[0-9][0-9][0-9][0-9]_/ /;
s/\[//g;
s/\]//g;
s/-[0-9][0-9][0-9][0-9]-[0-9][0-9].[0-9][0-9].[0-9][0-9].[0-9][0-9]//;
s/-/ - /g;
s/ - - / -- /g;
unless ($_ =~ /^_$/) { s/_/ /g }
s/\&/_/g;
s/\,\,/\,/g;
unless ($_ =~ /\.ass/) {
s/\....$/.mp4/;
s/\.....$/.mp4/;
s/ +\.mp4/.mp4/;
}
s/^ +//;
s/ \, /\, /g;
s/\./ /g;
s/ mp4 ass$/.mp4.ass/;
s/ ass$/.ass/;
s/ mp4$/.mp4/;
$_=uc(substr($_, 0,1)) . substr($_, 1);
s/( [a-z])/uc($1)/ge;
s/ The\./\, The\./;
s/ Der\./\, Der\./;
s/ Die\./\, Die\./;
s/ Das\./\, Das\./;
s/,,/,/g;
s/S([0-9][0-9])\.E([0-9][0-9])/S$1E$2/i;
s/S([0-9][0-9])E([0-9][0-9])/S$1E$2/i;
s/S([0-9][0-9]) E([0-9][0-9])/S$1E$2/i;
s/-S([0-9][0-9])E([0-9][0-9])-/ S$1E$2 /i;
s/- S([0-9][0-9])E([0-9][0-9]) -/ S$1E$2 /i;
s/S([0-9][0-9])E([0-9][0-9]) -/ S$1E$2 /i;
s/- S([0-9][0-9])E([0-9][0-9])/ S$1E$2 /i;
s/- S([0-9][0-9])E([0-9][0-9]) -/ S$1E$2 /i;
s/\(.............\)//;
s/ E([0-9][0-9]) / S01E$1 /i;
s/Teil([0-9])/Teil $1/;
s/ Tuer/ Tür/g;
s/ Fuer/ Für/g;
s/uerde/ürde/g;
s/raeum/räum/g;
s/ Ueber/ Über/g;
s/ Entfuehrt/ Entführt/g;
s/ Rueckkehr/ Rückkehr/g;
s/lueh/lüh/g;
# Blümchen/Mauerblünchen
s/luemchen/lümchen/g;
s/ Zurueck/ Zurück/g;
# Fänger/Traumfänger
s/aenger/änger/g;
# Erlöser, lösen
s/oese/öse/g;
# Nadelöhr
s/oehr/öhr/g;
# Fälle, Grenzfälle, Sonderfälle
s/aelle/älle/g;
s/chuesse/chüsse/g;
s/chluessel/chlüssel/g;
s/aesslich/ässlich/g;
s/ Duerre/ Dürre/g;
s/ Fuss/ Fuß/g;
s/ Fuesse/ Füße/g;
s/uessel/üssel/g;
s/ Toedlich/ Tödlich/g;
s/oete/öte/g;
s/etruege/etrüge/g;
s/ewaehr/ewähr/g;
s/uegner/ügner/g;
s/ Faelle/ Fälle/g;
s/ Hoelle/ Hölle/g;
s/ Familiaer/ Familiär/g;
s/aeuber/äuber/g;
s/espraech/espräch/g;
s/ Ueber/ Über/g;
s/ueber/über/g;
s/oegel/ögel/g;
s/aeglich/äglich/g;
s/ruess/rüß/g;
s/ Gemaelde/ Gemälde/g;
s/aeger/äger/g;
s/ Aetzend/ Ätzend/g;
s/ Kuerbis/ Kürbis/g;
s/muell/müll/g;
s/ Muell/ Müll/g;
s/oehe/öhe/g;
s/efaehr/efähr/g;
s/rueder/rüder/g;
s/uenf/ünf/g;
s/woelf/wölf/;
s/efuehl/efühl/g;
s/aesche/äsche/g;
s/elaehmt/elähmt/g;
s/rosse/roße/g;
s/roess/röß/g;
s/choen/chön/g;
s/eschaeft/eschäft/g;
s/aerten/ärten/g;
s/moerd/mörd/g;
s/ Heiss/ Heiß/g;
s/aehre/ähre/g;
s/oerder/örder/g;
s/lueck/lück/g;
s/chueler/chüler/g;
s/oenig/önig/g;
# gräbt, Gräber
s/raeb/räb/g;
s/rwaehlt/rwählt/g;
s/aester/äster/g;
s/uehne/ühne/g;
s/boes/bös/g;
s/ Boes/ Bös/g;
s/uerger/ürger/g;
s/eruehmt/erühmt/g;
s/ergnuegung/ergnügung/g;
s/laest/läst/g;
s/ruebsal/rübsal/g;
s/chlaegt/chlägt/g;
s/Koepfchen/Köpfchen/g;
s/oeglich/öglich/g;
s/aengen/ängen/g;
s/loede/löde/g;
s/uerdig/ürdig/g;
s/aelzen/älzen/g;
s/ruetet/rütet/g;
s/aeltig/ältig/g;
s/ Aengst/ Ängst/g;
s/aedchen/ädchen/g;
s/errueckt/errückt/g;
s/muesier/müsier/g;
s/ Raeder/ Räder/g;
s/ Moechte/ Möchte/g;
s/ Wuete/ Wüte/g;
s/ Baer/ Bär/g;
s/baer/bär/g;
s/aeuptling/äuptling/g;
s/lueger/lüger/g;
s/eaechtet/eächtet/g;
s/aecheln/ächeln/g;
s/uengste/üngste/g;
s/waerts/wärts/g;
s/uetter/ütter/g;
s/uess/süß/g;
s/uende/ünde/g;
s/aeter/äter/g;
s/aetsel/ätsel/g;
s/osse/sße/g;
s/gross/groß/g;
s/roehn/röhn/g;
s/kuere/küre/g;
s/raegt/rägt/g;
s/aechste/ächste/g;
s/oennen/önnen/g;
s/uerge/ürge/g;
s/aende/ände/g;
s/ruefe/rüfe/g;
s/aempf/ämpf/g;
s/oetter/ötter/g;
s/chaerf/chärf/g;
s/luester/lüster/g;
s/ Aera/ Ära/g;
s/ Woelfe/ Wölfe/g;
s/schwoer/schwör/g;
s/aechte/ächte/g;
s/uenn/ünn/g;
s/aette/ätte/g;
s/Croß/Cross/g;
s/Luegen/Lügen/g;
s/Faeuste/Fäuste/g;
s/ ö/ Ö/g;
s/ ü/ Ü/g;
s/ ä/ Ä/g;
s/\,+/\,/g;
s/^Der (.+) (S[0-9][0-9]E[0-9][0-9])/$1, Der $2/;
s/^Die (.+) (S[0-9][0-9]E[0-9][0-9])/$1, Die $2/;
s/^Das (.+) (S[0-9][0-9]E[0-9][0-9])/$1, Das $2/;
s/^The (.+) (S[0-9][0-9]E[0-9][0-9])/$1, The $2/;
s/^\-//;
s/\- \-//g;
s/ \.mp4$/.mp4/;
s/\-\././g;
s/ +/ /g;
s/ \(\.mp4$/.mp4/;
s/ \- \- / -- /g;
#$_="$_" . "\.mp4" unless ($_ =~ /\.mp4/);
# episodentitel entfernen?
#s/ (S[0-9][0-9]E[0-9][0-9]).+\.mp4/ $1.mp4/;
s/, The//;
s/^_// unless ($_ =~ /^_$/);
s/\(([0-9][0-9][0-9][0-9])\)/$1/g;
s/ - Id - 14755//;