how can i discard accents?

Support for Ubuntu and other Desktop Linux distributions
Post Reply
manias21
Posts: 6
Joined: 22 Mar 2020, 21:32

how can i discard accents?

Post by manias21 » 24 Mar 2020, 00:15

[DUPLICATE] from [/STORAGE/SERIES/8 TAGE/Temporada 1/8 TAGE 1x01.mkv] to [/STORAGE/SERIES2/SERIES/8 Días/Temporada1/8 Días - 1x01 - Pánico.mkv]

/STORAGE/SERIES2/SERIES/8 Días/Temporada1/8 Días - 1x01 - Pánico.mkv

how can i discard accents?

filebot -script 'fn:amc' /STORAGE/SERIES/ --output /STORAGE/SERIES2/ --action duplicate -non-strict --order Airdate --conflict fail --lang es --format "SERIES/{n}/Temporada{s}/{n} - {sxe} - {t}" --def 'ut_label=TV' 'music=y' 'unsorted=y' 'skipExtract=y' 'excludeList=.excludes' --apply refresh --log info --log-file '/STORAGE/SERIES2/filebot.log'

kim
Power User
Posts: 898
Joined: 15 May 2014, 16:17

Re: how can i discard accents?

Post by kim » 24 Mar 2020, 02:36

Code: Select all

{'/STORAGE/SERIES2/SERIES/8 Días/Temporada1/8 Días - 1x01 - Pánico.mkv'.transliterate('Latin-ASCII') }
output: /STORAGE/SERIES2/SERIES/8 DA-as/Temporada1/8 DA-as - 1x01 - PA¡nico.mkv

Code: Select all

{'/STORAGE/SERIES2/SERIES/8 Días/Temporada1/8 Días - 1x01 - Pánico.mkv'.ascii() }
output: /STORAGE/SERIES2/SERIES/8 DA-as/Temporada1/8 DA-as - 1x01 - PA nico.mkv

Code: Select all

{n.ascii()}
https://www.filebot.net/naming.html

manias21
Posts: 6
Joined: 22 Mar 2020, 21:32

Re: how can i discard accents?

Post by manias21 » 25 Mar 2020, 02:07

Mr. Kim, thanks for your reply,
but the truth is that I am very basic in this, I have read several times the post it mentions, but the changes it mentions do not apply.

Can you help me a little more and tell me how it is applied?
the characters and the lowercase I am also trying and I cannot.

manias21
Posts: 6
Joined: 22 Mar 2020, 21:32

Re: how can i discard accents?

Post by manias21 » 25 Mar 2020, 02:31

edit.
Last edited by manias21 on 25 Mar 2020, 03:11, edited 1 time in total.

manias21
Posts: 6
Joined: 22 Mar 2020, 21:32

Re: how can i discard accents?

Post by manias21 » 25 Mar 2020, 02:34

mmmmm.....? fail... help..

filebot -script 'fn:amc' /STORAGE/SERIES-TMP/ --output /STORAGE/ --action duplicate -non-strict --order Airdate --conflict fail --lang es --format "SERIES/{n}/Temporada{s}/{n.replaceTrailingBrackets()} - {s+'x'}{e.pad(2)} - {t.removeAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, "'")" --def 'ut_label=TV' 'music=y' 'unsorted=y' 'skipExtract=y' 'excludeList=.excludes' --apply refresh --log info --log-file '/STORAGE/SERIES-TMP/filebot.log'

kim
Power User
Posts: 898
Joined: 15 May 2014, 16:17

Re: how can i discard accents?

Post by kim » 25 Mar 2020, 03:42

Something like this:

Code: Select all

-format "SERIES/{n.ascii()}/Temporada{s}/{n.replaceTrailingBrackets().ascii()} - {s+'x'}{e.pad(2)} - {t.removeAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, "'").ascii()"
(I did not test it)

User avatar
rednoah
The Source
Posts: 17864
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: how can i discard accents?

Post by rednoah » 25 Mar 2020, 04:26

@manias21

Step 1: Prototype your format in the GUI.

Image

Step 2: Do not skimp on Step 1. If and when you have thoroughly tested your custom format in the GUI, then and only then move forward to integrating your custom format into the CLI.

Step 3: Integrate your custom format into your filebot command.


:idea: Use the @file syntax for reading command-line arguments from external text files so you don't have to worry about the intricacies of Cmdline and Argument Passing.
:idea: Please read the FAQ and How to Request Help.

manias21
Posts: 6
Joined: 22 Mar 2020, 21:32

Re: how can i discard accents?

Post by manias21 » 26 Mar 2020, 06:01

--format /SERIE/{n}/Temporada{s}/{n} - {sxe} - {t}

I have continued the mentioned steps.
attached image...
But surely I have not explained myself well,
when I perform tests ... the names of some series and the resulting information is managed with tildes and some characters, how can I define that it does not happen.
  In which parameter can characters and accents be avoided?

Image
http://img4.imagetitan.com/img.php?image=21_test322.jpg


without using a sh ..

Code: Select all

FILES=$1
convmv --notest -f latin1 -t utf8 -r $FILES > /dev/null 2>&1
convmv --notest -f iso8859-1 -t utf8 -r $FILES > /dev/null 2>&1

find $FILES -type f -name '*.mkv' -exec sh -c '
  for f do
    echo Processing "$f"
    rename "s/à/a/g" "$f"
    rename "s/á/a/g" "$f"
    rename "s/è/e/g" "$f"
    rename "s/é/e/g" "$f"
    rename "s/ì/i/g" "$f"
    rename "s/í/i/g" "$f"
    rename "s/ò/o/g" "$f"
    rename "s/ó/o/g" "$f"
    rename "s/ù/u/g" "$f"
    rename "s/ú/u/g" "$f"
    rename "s/ü/u/g" "$f"
    rename "s/ñ/n/g" "$f"
    rename "s/À/A/g" "$f"
    rename "s/Á/A/g" "$f"
    rename "s/È/E/g" "$f"
    rename "s/É/E/g" "$f"
    rename "s/Ì/I/g" "$f"
    rename "s/Í/I/g" "$f"
    rename "s/Ò/O/g" "$f"
    rename "s/Ó/O/g" "$f"
    rename "s/Ù/U/g" "$f"
    rename "s/Ù/U/g" "$f"
    rename "s/Ü/U/g" "$f"
    rename "s/Ñ/N/g" "$f"
    rename "s/Ç/C/g" "$f"
    rename "s/ç/c/g" "$f"
    rename "s/[@\{\}\¿\?\€]//g" "$f"
    rename "s/(    )/ /g" "$f"
    rename "s/(   )/ /g" "$f"
    rename "s/(  )/ /g" "$f"
  done
' sh {} +

manias21
Posts: 6
Joined: 22 Mar 2020, 21:32

Re: how can i discard accents?

Post by manias21 » 27 Mar 2020, 20:38

With help everything is accomplished. (salva)

Code: Select all

#!/bin/bash

CONFLICT="skip"
EXCLUDE_FILE="/STORAGE/.excludes"
OUT_FILES="/STORAGE/TMP/"
OUT_FILES2="/STORAGE/TMP/"
R0=".removeAll(/[¡!?¿#,@'{}.]/)"
R1=".replaceAll(/[á]/,'a').replaceAll(/[é]/,'e').replaceAll(/[í]/,'i').replaceAll(/[ó]/,'o').replaceAll(/[ú]/,'u').replaceAll(/[ü]/,'u')"
R2=".replaceAll(/[Á]/,'A').replaceAll(/[É]/,'E').replaceAll(/[Í]/,'I').replaceAll(/[Ó]/,'O').replaceAll(/[Ú]/,'U').replaceAll(/[Ü]/,'U')"
R3=".replaceAll(/[à]/,'a').replaceAll(/[è]/,'e').replaceAll(/[ì]/,'i').replaceAll(/[ò]/,'o').replaceAll(/[ù]/,'u').replaceAll(/[û]/,'u')"
R4=".replaceAll(/[À]/,'A').replaceAll(/[È]/,'E').replaceAll(/[Ì]/,'I').replaceAll(/[Ò]/,'O').replaceAll(/[Ù]/,'U').replaceAll(/[Û]/,'U')"
R5=".replaceAll(/[Ñ]/,'N').replaceAll(/[ñ]/,'n').replaceAll(/[&]/,'y')"
RPL=$R0$R1$R2$R3$R4$R5

PARAMS="-non-strict --order Airdate --conflict $CONFLICT --lang es --encoding utf8 --apply refresh --log fine --log-file 'filebot.log' --def skipExtract=y excludeList=$EXCLUDE_FILE"

filebot -script "fn:amc" "$1" -no-xattr --output $OUT_FILES2 $PARAMS --format "$OUT_fILES/{n$RPL}/Temporada {s}/{n$RPL} - {sxe} - {t$RPL}" --action duplicate

#--action TEST
#--action move
#--action duplicate

User avatar
rednoah
The Source
Posts: 17864
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: how can i discard accents?

Post by rednoah » 28 Mar 2020, 05:15

Use {plex} or {kodi} because those generally take care of normalizing and validating the file path:

Code: Select all

{plex}
viewtopic.php?t=4116


Alternatively, the String.ascii() function can be used to strip and normalize non-ASCII characters:

Code: Select all

{n.ascii()}
https://www.filebot.net/naming.html
:idea: Please read the FAQ and How to Request Help.

Post Reply