Having problem filtering '$' character

Any questions? Need some help?
Post Reply
belgarth
Posts: 30
Joined: 25 Jan 2012, 09:19

Having problem filtering '$' character

Post by belgarth »

I'm working on setting up a filter to block the series Title "Vega$", but I am having a problem figuring out how to match against the '$' character:

Input: /home/belgarth/Downloads/Unsorted/Vegas (2012) - S01E11 - Serve, Volley and Kill.mkv
Group: [tvs:Vega$] => [Vegas (2012) - S01E11 - Serve, Volley and Kill.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [Vega$, Vegas]
Fetching episode data for [Vega$]
Fetching episode data for [Vegas]
Fetching episode data for [Vegas]
Fetching episode data for [Vegas (2012)]
Fetching episode data for [Vegas Strip]
Fetching episode data for [Vegas Stripped]
Fetching episode data for [Vegas Confessions]
Fetching episode data for [Vegas: The City the Mob Made]
Apply Filter: {!(n ==~ /Vegas/) && !(n ==~ /Smash Hit/) && !(n ==~ /Smash/) && !(n ==~ /SMASH/) && !(n ==~ /Vega$/)}
...
[MOVE] Rename [/home/belgarth/Downloads/Unsorted/Vegas (2012) - S01E11 - Serve, Volley and Kill.mkv] to [/home/belgarth/Downloads/TV Shows/Vega$/Season 1/Vega$ - S01E11 - Serve, Volley and Kill.mkv]

Is there something needed to switch "!(n ==~ /Vega$/)" to instead to correct filter this out?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Having problem filtering '$' character

Post by rednoah »

In regex $ means end-of-input so you'll need to escape that to match the literal $, i.e.

Code: Select all

"!(n ==~ /Vega\$/)"
But do you really need to filter this out? Ideally FileBot should be able to pick the right episode even if multiple shows have the same series name.
:idea: Please read the FAQ and How to Request Help.
belgarth
Posts: 30
Joined: 25 Jan 2012, 09:19

Re: Having problem filtering '$' character

Post by belgarth »

That was my first guess, but adding in a regex escape doesn't help, it seems to get ignored:
belgarth@server1:~/bin$ filebot -non-strict -trust-script --conflict override -script "/home/belgarth/bin/utorrent-postprocess.groovy" --filter "!(n ==~ /Vegas/) && !(n ==~ /Smash Hit/) && !(n ==~ /Smash/) && !(n ==~ /SMASH/) && !(n ==~ /Vega\$/)" --output "/home/belgarth/Downloads/" --action copy --conflict override --def subtitles=false artwork=false "ut_dir=/home/belgarth/Downloads/Unsorted" "ut_file=" "ut_kind=" "ut_title=" "ut_label=" "ut_state="
Parameter: subtitles = false
Parameter: artwork = false
Parameter: ut_dir = /home/belgarth/Downloads/Unsorted
Parameter: ut_file =
Parameter: ut_kind =
Parameter: ut_title =
Parameter: ut_label =
Parameter: ut_state =
Input: /home/belgarth/Downloads/Unsorted/Vegas - S01E11.mkv
Group: [tvs:Vega$] => [Vegas - S01E11.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [Vega$, Vegas]
Fetching episode data for [Vega$]
Fetching episode data for [Vegas]
Fetching episode data for [Vegas]
Fetching episode data for [Vegas (2012)]
Fetching episode data for [Vegas Strip]
Fetching episode data for [Vegas Stripped]
Fetching episode data for [Vegas Confessions]
Fetching episode data for [Vegas: The City the Mob Made]
Apply Filter: {!(n ==~ /Vegas/) && !(n ==~ /Smash Hit/) && !(n ==~ /Smash/) && !(n ==~ /SMASH/) && !(n ==~ /Vega$/)}
...
[COPY] Rename [/home/belgarth/Downloads/Unsorted/Vegas - S01E11.mkv] to [/home/belgarth/Downloads/TV Shows/Vega$/Season 1/Vega$ - S01E11 - Serve, Volley and Kill.mkv]
Processed 1 files
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Having problem filtering '$' character

Post by rednoah »

An. The cmdline itself my resolve escaped characters. You could try double escaping, one for cmdline and one for the regex, \\$ or maybe just [$]

PS: Seems it became to smart with the latest update recognising $ as an 's' type character... I'll have a look.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Having problem filtering '$' character

Post by rednoah »

All cases I tried work, also with both TVRage and TheTVDB I get shows a bit different from your log.

btw here's how I'd write the filter:

Code: Select all

--filter "!(n ==~ /(?i:vega.|smash|smash.hit)/)"
:idea: Please read the FAQ and How to Request Help.
Post Reply