Page 2 of 2

Re: Remove language from subtitle name

Posted: 01 Mar 2015, 18:33
by xflak
Got that working thanks. it seems every question I ask leads to 10 more, lol, so I really appreciate your patience.

1- Is it possible to specify custom tv series titles? For example, instead of Dragons' Den CA I use Dragons' Den Canada.

2- I already managed to get vc included as part of the naming format for only 720p and 1080p using the match function. I want to do something similar for subtitles lang. Basically I want to include the {.lang} tag for non-english subtitles only. So videos and eng subs will exclude/ignore the Lang tag when renaming.

Edit: also I noticed the amc script doesn't have an argument for xbmc username/passwords, am I missing something or will it only work if there's no password set?

Re: Remove language from subtitle name

Posted: 01 Mar 2015, 19:41
by rednoah
1.
You set the rules in your format. I recommend having a .csv file with your mappings and having your format code refer to that.

2.
Again, your format your rules.

e.g.

Code: Select all

{lang =~ 'eng' ? lang : null}

Re: Remove language from subtitle name

Posted: 02 Mar 2015, 03:45
by xflak
Omg this tool is capable of so much it's overwhelming.

Not sure if u saw my edit above with another q about xbmc.

But also wanted to know if there a way to stop filebot from attempting to download subs when the anti-leech limit is met? I am running a script daily to download 200 missing subs at a time. So I would like it to close after the limit is reached instead of running pointlessly for another hour or two.

Re: Remove language from subtitle name

Posted: 02 Mar 2015, 03:54
by rednoah
There's currently no good way. I highly recommend upgrading your OpenSubtitles account if you need higher limits.

Otherwise you can probably script something together with the output of filebot -script fn:osdb.stats to check if the limit has been reached or not.

Re: Remove language from subtitle name

Posted: 02 Mar 2015, 19:57
by xflak
Even if I upgrade my account I will only be able to download 1000 subtitles a day and I will still hit that maximum and have filebot needlessly running and spending resources trying to get more. And even if I were to check my current limit there's no way for me to have filebot just download up to my limit so that doesn't help.

I'd like to make a feature request if I may. Can you have filebot stop checking for subs when the limit is reached? I.e. break the current command/operation only when the anti-leech message is received. Alternatively if it's easier maybe u could add an argument for the max download attempts? Then I could set it at 200 and worst case scenario I see the anti-leech message 200 times (if I had already reached my limit) instead of thousands.

What do you think?
thx

Re: Remove language from subtitle name

Posted: 03 Mar 2015, 02:05
by xflak
I got another question, how can I get filebot to skip jpg and nfo files when renaming?

I tried using --def ignore=.jpg and it didn't work. I tried using the cleaner script the folder before renaming but it doesn't delete jpg and nfo files if there's a large video file in the same directory.

Re: Remove language from subtitle name

Posted: 03 Mar 2015, 03:38
by rednoah
Looks like those file are excluded by default already. Are you using the amc script?

If you not you have to do the exclude logic yourself with find | egrep | xargs | filebot -rename ...

Code: Select all

Parameter: minFileSize = 0
Parameter: minLengthMS = 0
Parameter: ut_dir = /Users/reinhard/Test/AMC-TEST
Parameter: ut_kind = multi
Parameter: ut_label = test
Ignore hidden: /Users/reinhard/Test/AMC-TEST/.DS_Store
Input: /Users/reinhard/Test/AMC-TEST/Forever.US.S01E14.720p.HDTV.X264-DIMENSION.mkv
Exclude: /Users/reinhard/Test/AMC-TEST/Forever.US.S01E14.720p.HDTV.X264-DIMENSION.jpg
Exclude: /Users/reinhard/Test/AMC-TEST/Forever.US.S01E14.720p.HDTV.X264-DIMENSION.nfo
Group: [tvs:forever us] => [Forever.US.S01E14.720p.HDTV.X264-DIMENSION.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [Forever US]
Fetching episode data for [Forever (2014)]
[DUPLICATE] Rename [/Users/reinhard/Test/AMC-TEST/Forever.US.S01E14.720p.HDTV.X264-DIMENSION.mkv] to [/Users/reinhard/Test/OUTPUT/TV Shows/Forever (2014)/Season 01/Forever (2014) - S01E14 - Hitler on the Half-Shell.mkv]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ

Re: Remove language from subtitle name

Posted: 09 Mar 2015, 16:05
by xflak
Last Question. For some reason renaming from the gui and from cmd line using the same format are yielding slightly different results. The GUI is working fine, I'm hoping you can help me get the same results from cmd line.

So the issue only occurs when renaming multi-episode tv shows. For example renaming:
"Teenage.Mutant.Ninja.Turtles.2012.S03E12E13.Battle.for.New.York.720p.WEB-DL.AAC2.0.H.264-iT00NZ"
via cmd line results in "S03E12 Battle for New York (1) [720p].mkv"
and via the GUI results in "S03E12-E13 Battle for New York [720p].mkv"

Is there a way for me to get the cmd line to give the same output as the GUI?

the cmd I'm using specifically is:
filebot.exe -rename --action move --conflict auto --db theTVDB -r -non-strict --format "\\Nas\video\TV\{csv('list.csv').get(n) ?: n}\Season {s}\{s00e00} {t}{' ['+vf.match(/720[pP]|1080[pP]/)+']'}{lang =~ 'eng' ? null : '.'+ lang}" "C:\Users\Admin\Downloads\TV"

I finished my whole script and was about to share it in these forums when I noticed this issue. I'd like to address it before sharing, thanks!

Edit:
rednoah and I took this "offline" and discussed further in PMs. Turns out this was a problem with FileBot but has been fixed in r2837 (March 2015)

Re: Remove language from subtitle name

Posted: 18 Mar 2015, 20:49
by xflak
rednoah wrote:Looks like those file are excluded by default already. Are you using the amc script?

If you not you have to do the exclude logic yourself with find | egrep | xargs | filebot -rename ...

Code: Select all

Parameter: minFileSize = 0
Parameter: minLengthMS = 0
Parameter: ut_dir = /Users/reinhard/Test/AMC-TEST
Parameter: ut_kind = multi
Parameter: ut_label = test
Ignore hidden: /Users/reinhard/Test/AMC-TEST/.DS_Store
Input: /Users/reinhard/Test/AMC-TEST/Forever.US.S01E14.720p.HDTV.X264-DIMENSION.mkv
Exclude: /Users/reinhard/Test/AMC-TEST/Forever.US.S01E14.720p.HDTV.X264-DIMENSION.jpg
Exclude: /Users/reinhard/Test/AMC-TEST/Forever.US.S01E14.720p.HDTV.X264-DIMENSION.nfo
Group: [tvs:forever us] => [Forever.US.S01E14.720p.HDTV.X264-DIMENSION.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [Forever US]
Fetching episode data for [Forever (2014)]
[DUPLICATE] Rename [/Users/reinhard/Test/AMC-TEST/Forever.US.S01E14.720p.HDTV.X264-DIMENSION.mkv] to [/Users/reinhard/Test/OUTPUT/TV Shows/Forever (2014)/Season 01/Forever (2014) - S01E14 - Hitler on the Half-Shell.mkv]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ
Can I exclude extensions like txt and jpg using something like this?
--def ignore=.txt --def ignore=.jpg

edit:
just tested it and seems to not work. If there's some way to get this working it would be very much appreciated. Thanks!

Re: Remove language from subtitle name

Posted: 19 Mar 2015, 03:37
by rednoah
Since the ignore pattern is applied to the path I'm sure that it's working. But you can't do is specifing the same option multiple times, most likely only last one will count. Also it's a regex so . is not what you think

If you wanted to ignore jpg and txt files you'd write a regex like so:

Code: Select all

--def "ignore=[.](jpg|txt)$"

Re: Remove language from subtitle name

Posted: 19 Mar 2015, 11:40
by xflak
Thanks I'll test it out and add it to uFiler (assuming it works).

Where was this knowledge the first time I asked? Does FileBot have so many bells and whistles that even you have a hard time keeping track of them all? lol

Re: Remove language from subtitle name

Posted: 19 Mar 2015, 11:50
by rednoah
--def ignore=regex Ignore filepaths that match the given regular expression
;)

PS: I didn't notice you asked how to use --def ignore before :?

Re: Remove language from subtitle name

Posted: 20 Mar 2015, 00:22
by xflak
so I tried using --def "ignore=[.](jpg|txt)$" and it's not ignoring txt files. Am I doing something wrong? The exact cmd I'm using is:

Code: Select all

"C:\Program Files\FileBot\filebot.exe" -rename --action copy --conflict auto --db theTVDB -r -non-strict --def "ignore=[.](jpg|txt)$" --format "C:\Users\XFlak\Desktop\out\TV\{n}\Season {s}\{s00e00} {t}{lang =~ 'eng' ? null : '.'+ lang}" "C:\Users\XFlak\Desktop\in"
Thanks!

Re: Remove language from subtitle name

Posted: 20 Mar 2015, 05:59
by rednoah
The --def parameters are for scripting, so --def ignore will only work in the amc script, or other script that support that parameter.

Simple -rename, -get-subtitles, etc does not support what you want, because you're supposed to select the files you want before passing them on to filebot, i.e. instead of passing in a folder you should pass in all the files you want to process.

On Linux/Mac you'd do this with some simple find | xargs | filebot call but on Windows you'll have to find some equivalent for that, or use a Groovy script.

Re: Remove language from subtitle name

Posted: 01 Jul 2015, 16:21
by shotar
Is it possible to remove the language in the .srt file using the amc script?

Re: Remove language from subtitle name

Posted: 01 Jul 2015, 18:03
by rednoah
Yes. By providing your own --format that doesn't include the language tag.

Re: Remove language from subtitle name

Posted: 01 Jul 2015, 21:49
by shotar
I tried by adding --format "{n} ({y} {sdhd})" but it seems to have no effect. here's my complete expression:

Code: Select all

filebot -script fn:amc --output "/volume1/downloads/nice" --format "{n} ({y} {sdhd})" --log-file /volume1/downloads/amc.log --action move -non-strict "/volume1/downloads/complete" --def subtitles=en --conflict auto --def pushover=****:**** --def clean=y --def "ut_label=movie"
before that I had

Code: Select all

--def "movieFormat=Movies/{fn}"
What is the difference between --format and --def movieFormat?

Re: Remove language from subtitle name

Posted: 02 Jul 2015, 03:51
by rednoah
If you're using the amc script then --format has no effect. Instead you need to use the amc specific anime/series/movie format options.

Re: Remove language from subtitle name

Posted: 02 Jul 2015, 07:24
by shotar
So what would be your suggestion? I'm using filebot just for renaming new downloaded movies. Should I modify the amc script or use the different filebot functions (which are rename, get subtitles and clean, correct?)?

Re: Remove language from subtitle name

Posted: 02 Jul 2015, 12:09
by rednoah
You need to use --def movieFormat if you want to override the default format that is used for movies in the amc script. You don't have to modify the script.

Re: Remove language from subtitle name

Posted: 02 Jul 2015, 20:25
by shotar
oh now I get it :D

Now I would like to add the IMDB rating and found this code on the forum:

Code: Select all

{net.sourceforge.filebot.WebServices.TMDb.getMovieInfo(movie, Locale.ENGLISH).rating}
but it doesn't seems to work..

Another question: If a subtitle is not found by hash, why Filebot is not searching with the movie name?

Re: Remove language from subtitle name

Posted: 03 Jul 2015, 14:48
by rednoah
1.
FileBot does not support IMDB.

I recommend {rating} which is the rating from your chosen datasource:

Code: Select all

{rating}
Alternatively you can grab {omdb} data (which is NOT IMDB) specifically:

Code: Select all

{omdb.rating}
2.
Hash lookup is fast and reliable => good default
Name search is slow and unreliable => bad default

You can always call the suball script, for -non-strict subtitle search and other reasons => viewtopic.php?f=4&t=5#p8871