POSTBUCKET - where random posts in unrelated topics go

Any questions? Need some help?
Post Reply
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Q&A for n00bs

Post by rednoah »

Code: Select all

To connect to app.filebot.net insecurely, use `--no-check-certificate'.
So have you tried --no-check-certificate yet?
:idea: Please read the FAQ and How to Request Help.
saitoh183
Posts: 112
Joined: 02 Oct 2012, 16:59

Re: Q&A for n00bs

Post by saitoh183 »

Quick question about this filter: 'age < 7 || !model.any{ it.age < 7 }'

What does this portion !model.any{ it.age < 7 } tell filebot to do. I have searched the forum to try to understand but i didnt find anything.
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Q&A for n00bs

Post by rednoah »

rednoah wrote:only include episode data of recently aired episodes if there are any recently aired episodes, but otherwise default to accepting any episode data.

Code: Select all

--filter "age < 7 || !model.any{ it.age < 7 }"
@see viewtopic.php?f=3&t=2127


{age} is the age of the episode you're including or excluding. {model.age} is a list of all age values for all episodes in the current context. It's easy if you open the Format Editor on some real data and then just play with it for a few minutes.

model.any{ it.age < 7 } ... out of all the episodes being considered, is there any single episode that was aired within the last 7 days, yes or no?
:idea: Please read the FAQ and How to Request Help.
Manu
Posts: 5
Joined: 15 Nov 2016, 22:08

AMC Illegal usage: no input

Post by Manu »

Hi,

I've been using Filebot and AMC with qbittorrent without a problem since march. I have no idea what has gone wrong, but it hasn't worked for two weeks now.

Here's what I have in qbittorrent
filebot -script fn:amc --output "L:/SARJAT" --action duplicate --conflict skip -non-strict --log-file amc.log --def excludeList=amc.excludes unsorted=y music=y artwork=y "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L" --def movieFormat="J:/{ny}/{fn}"
And here's what the .log file says
Run script [fn:amc] at [Wed Nov 16 00:05:10 EET 2016]
Parameter: excludeList = amc.excludes
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = y
Parameter: ut_dir = %F
Parameter: ut_kind = multi
Parameter: ut_title = %N
Parameter: ut_label = %L
Parameter: movieFormat = J:/{ny}/{fn}
Bad ut_dir value: %F
Bad ut_title value: %N
Bad ut_label value: %L
Illegal usage: no input
Failure (°_°)
There could be a mistake in the qbittorrent part, I rewrote it after AMC stopped working.

also in the qbittorrent my temp folder is: L:\temp
and finished download folder is: L:\_SORT

I investigated and concluded that AMC doesn't get the labels from qbittorrent, which is the reason everything is broken. I have no idea why tho.

I changed the command to something that is a bit closer that I had before.
filebot -script fn:amc --output "L:/SARJAT" --action duplicate --conflict skip -non-strict --log-file amc.log --def excludeList=amc.excludes unsorted=y music=y artwork=y "ut_dir=%F" "ut_kind=multi" "ut_title=%N" "ut_label=%L" --def movieFormat="J:/_Elokuvat/{n} ({y})/{fn}" --def seriesFormat="L:/SARJAT/{n}/{'Season '+s}/{fn}"
Please help me, after using the AMC for so long and it now being broken is driving me suicidal.

From Finland with Love,
Manu

EDIT: Got it working by reinstalling qbittorrent again.
i10
Posts: 14
Joined: 12 Nov 2016, 23:14

Re: Exclude Blacklist & Series-Mappings

Post by i10 »

V > V (2009)
OUaT > Once Upon a Time
Person > Person of Interest
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

Examples for file paths that are misidentified would be helpful for testing.

@see viewtopic.php?f=3&t=1868
:idea: Please read the FAQ and How to Request Help.
i10
Posts: 14
Joined: 12 Nov 2016, 23:14

Re: Exclude Blacklist & Series-Mappings

Post by i10 »

GUI, TheTVDB:
Person.of.Interest\Person s01e01
V\V s01e01
Once.Upon.a.Time\OUaT s01e01
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

1.
It seems that some optimization broke file parsing, and it ended up applying "file name without extension" logic to folder names, so it was search for "Person.of" and "Once.Upon.a" which makes no sense.


2.
V is just one letter, so it's tricky. If you process many episodes of different shows at once the V will probably be ignored. If you then process only one of V in a single batch (or better yet, many episodes of V) then it'll work better.
:idea: Please read the FAQ and How to Request Help.
i10
Posts: 14
Joined: 12 Nov 2016, 23:14

Re: Exclude Blacklist & Series-Mappings

Post by i10 »

opportunistic mode:
Image
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

Yes, it's a bug, cause it should pick the right show based on the folder name.

Nothing that can be fixed by adding entries to the blacklist.

I'll upload a new build later you can test.
:idea: Please read the FAQ and How to Request Help.
i10
Posts: 14
Joined: 12 Nov 2016, 23:14

Re: Exclude Blacklist & Series-Mappings

Post by i10 »

It shouldn't match "Person" with "Personal Taste" at all.
UKenGB
Posts: 49
Joined: 04 Jan 2017, 09:26

Re: Conditional Structures (if-then-else)

Post by UKenGB »

Can either method be nested?

Any 'case' structures possible?
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Conditional Structures (if-then-else)

Post by rednoah »

1.
Yes, ternary expressions and all control structures in general can be nested, as one would expect from a general purpose programming language.

2.
Yes, but switch statements tend to be a bit too verbose for my taste for simple format expressions.
:idea: Please read the FAQ and How to Request Help.
xflak
Power User
Posts: 53
Joined: 25 Feb 2015, 01:51

Re: [SNIPPET] Override/Hardcode Series Names

Post by xflak »

So I just updated filebot, and relative path references I used in my old code stopped working

Code: Select all

{csv('list.csv').get(n) ?: n}
to get it to work I had to replace the relative path with the absolute path

Code: Select all

{csv('C:/Program Files/FileBot/list.csv').get(n) ?: n}
Not a huge deal, but wanted to report in case it can either get rolled back and\or just to notify other potentially having the same issue

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

Re: [SNIPPET] Override/Hardcode Series Names

Post by rednoah »

Relative paths passed to csv(...) are now expected to be relative to your $HOME directory.
:idea: Please read the FAQ and How to Request Help.
neutron
Posts: 8
Joined: 23 Aug 2015, 07:43

Re: Exclude Blacklist & Series-Mappings

Post by neutron »

How do i use those lists, or are they used automatically ?
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

They're used automatically.
:idea: Please read the FAQ and How to Request Help.
tatere
Posts: 2
Joined: 13 Mar 2017, 22:10

Re: Exclude Blacklist & Series-Mappings

Post by tatere »

The old version of the exclude blacklist file
http://app.filebot.net/data/exclude-blacklist.txt
is now just a wildcard -

Code: Select all

.*
The server I'm on is running an old version.

Is there any way to pass in an updated URL? It's in a properties file in the jar, would we have to alter and recompile from that?
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

:!: Using extremely outdated versions of FileBot is highly discouraged. FileBot hasn't been using HTTP for a loooong time.

:idea: Why don't you just use the latest version? That'd be much less effort than hacking some code from 2-3 years ago.
:idea: Please read the FAQ and How to Request Help.
tatere
Posts: 2
Joined: 13 Mar 2017, 22:10

Re: Exclude Blacklist & Series-Mappings

Post by tatere »

Sadly it's not up to me. I'll pass that on. It does seem like that file changed very recently to be a wildcard - like sometime last week.
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

You can let the decision maker know that running outdated software is not a good idea, and quite potentially a security risk.

In this case, I've made the change just to see what happens, but please note that since you're using HTTP a man-in-the-middle attacker could easily do the same and send back arbitrary patterns to change how FileBot works.
:idea: Please read the FAQ and How to Request Help.
dfur
Posts: 2
Joined: 25 Mar 2017, 07:25

Re: Q&A for n00bs

Post by dfur »

This may well be a n00b problem but it took me ages to pin down where the problem was. I couldn't get the AMC script working when I added the default format expression for TV shows (copied from here). I eventually narrowed the problem down to one character in this part of the expression

Code: Select all

t.replaceAll(/[`´‘’ʻ]/, /'/)
The first character in the regex is a "backtick" or more correctly a "grave accent" and it was causing my script to fail, or at least pause and display a > prompt. If I removed that one character or escaped it with a backslash, as below, the script worked perfectly

Code: Select all

[\`´‘’ʻ]
I am curious to know why this problem might have occured. I am v new to groovy, but I recall reading that in slashy strings, the only character that needed to be escaped was the forward slash. What could be going wrong here?
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Q&A for n00bs

Post by rednoah »

` has special meaning in cmd and bash:
rednoah wrote:Use the @file syntax for reading cmdline args from text files so you don't have to worry about quoting and escaping arguments
Groovy is your friend. CMD is not.
:idea: Please read the FAQ and How to Request Help.
dfur
Posts: 2
Joined: 25 Mar 2017, 07:25

Re: Q&A for n00bs

Post by dfur »

Wow! :o I've just read up on backticks and command substution in Bash. That's quite a powerful little character.

For the record, any command between a pair of backticks will be run first and the output used as part of the main command. A single backtick causes Bash to show a prompt and wait for a command. Entering another backtick returns control to the original command. In modern shells, $(some command) does the same as, and is preferred to `some command`

So my interpretation is that using the unescaped backtick in an expression it is ok if the Groovy script is run by uTorrent, but definitely not if its run in Bash or CMD. I'll look into your suggested solution of reading arguments from a text file.

Thank you rednoah
ffreese
Posts: 2
Joined: 09 May 2016, 14:18

Re: Exclude Blacklist & Series-Mappings

Post by ffreese »

Hi,
for me there was one big reason to stay at v 4.2 with the old gui: I run filebot on a server and use x2go for access.
As newer filebot versions need glx > V1.3 they simply do stall, because x2go is stuck at V1.2...

Maybe we could have a modern version with oldstyle-gui for older pc or x2go-users?
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

ffreese wrote:Hi,
for me there was one big reason to stay at v 4.2 with the old gui: I run filebot on a server and use x2go for access.
As newer filebot versions need glx > V1.3 they simply do stall, because x2go is stuck at V1.2...

Maybe we could have a modern version with oldstyle-gui for older pc or x2go-users?
How is this question related to Exclude Blacklist & Series-Mappings?

:idea: You can disable graphics acceleration to work around graphics issues. See FAQ for details. Java Swing and JavaFX fully support software rendering as far as I know.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Usage Examples

Post by rednoah »

1. Rename files with FileBot:

Code: Select all

$ filebot -rename *.mp4 --db TheMovieDB -non-strict
Rename movies using [TheMovieDB]
Auto-detect movie from context: [avatar.mp4]
[MOVE] From [avatar.mp4] to [Avatar (2009).mp4]
Processed 1 files
2. Confirm that FileBot metadata has been stored as xattr in the filesystem:

Code: Select all

$ filebot -script fn:xattr *.mp4
/path/to/Avatar (2009).mp4
	net.filebot.filename: avatar.mp4
	net.filebot.metadata: {"@type":"Movie","year":2009,"imdbId":499549,"tmdbId":19995,"language":"en","id":19995,"name":"Avatar","aliasNames":[]}
3. Use xattr metadata in filter and format expressions:

Code: Select all

$ filebot -mediainfo -r . --filter "y >= 2000" --format "{n} by {director}"
Avatar by James Cameron
4. Process xattr tagged files based on existing xattr metadata:

Code: Select all

filebot -rename -r . --db xattr --action copy --output /Volumes/USB --filter "episode && age < 30" --format "{n} - {sxe} - {t}"
:idea: Please read the FAQ and How to Request Help.
simmz
Posts: 5
Joined: 07 Apr 2017, 01:19

Process without --db ??

Post by simmz »

Is it possible to process files without the use of a database?

All I'm trying to do is organize a flat folder into sub-directories: e.g.

$:~/Movies> tree
.
├── Video - 01.mp4
├── Video - 02.mp4
├── Video - 03.mp4
├── Video - 04.mp4
└── Video - 05.mp4

Would be processed and become:

$:/mnt/data/test> tree
├── 480x270
│ └── Video - 03.mp4
├── 640x360
│ └── Video - 04.mp4
└── 960x540
├── Video - 01.mp4
├── Video - 02.mp4
└── Video - 05.mp4

I can accomplish this with:
$:~/filebot.sh -script fn:amc ./ --output "/mnt/data/sorted" --action copy --conflict auto --def "movieFormat={resolution}/{fn}"

but it pointlessly tried to identify/match the files.

I also tried:
filebot.sh -rename . --db xattr --action copy --format {resolution}/{fn}

which returns:
Rename files using [Extended Attributes]
Failed to identify or process any files
Failure (°_°)
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Q&A for n00bs

Post by rednoah »

-non-strict allows you to process files that are not xattr tagged:

Code: Select all

filebot -rename *.mp4 --action duplicate --db xattr -non-strict --format {resolution}/{fn}
@see viewtopic.php?f=4&t=4788
:idea: Please read the FAQ and How to Request Help.
simmz
Posts: 5
Joined: 07 Apr 2017, 01:19

Re: Q&A for n00bs

Post by simmz »

Really!?!?! that's all I was missing. I thought -non-strict was just for oddly named files.
Learn something new everyday. Your next beer is on me via paypal.
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Q&A for n00bs

Post by rednoah »

-non-strict has different meanings in different contexts. If you're using --db xattr with -non-strict then -non-strict refers to not strictly processing only xattr tagged files.
:idea: Please read the FAQ and How to Request Help.
simmz
Posts: 5
Joined: 07 Apr 2017, 01:19

Re: Q&A for n00bs

Post by simmz »

Makes sense. Thanks for your help. I spent the better part of the day trying to make that little one-liner work.
stephen147
Donor
Posts: 131
Joined: 01 Sep 2015, 22:40

Re: Presets

Post by stephen147 »

Could you add the ability to overwrite or keep file extension in the presets.

I overwrite my movies while keep extensions on TV programs.
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Presets

Post by rednoah »

Extension: Preserve / Override works independently of Presets and cannot be enabled/disabled via clicking a Preset.
stephen147 wrote:Could you add the ability to overwrite or keep file extension in the presets.
If I make it too easy, then the novice folks will accidentally delete all their extensions and then blame FileBot.
stephen147 wrote:I overwrite my movies while keep extensions on TV programs.
Why do your movie files have the wrong extension? I've never once come across a movie file with the wrong extension.
:idea: Please read the FAQ and How to Request Help.
stephen147
Donor
Posts: 131
Joined: 01 Sep 2015, 22:40

Re: Presets

Post by stephen147 »

Could that option not be enabled by default so the user can't tamper with it or warning if checkbox is ticked?

It's the only way to rename subtitles and movies together in same rename by using this:

Code: Select all

{n.replace(':','-').replaceAll(/[\/:*?"<>|]/,' - ')}    ({y})                   {any{fn.match(/(?i)25th.+?anniv/)}{''}.replaceAll(/(?i).*25th.+?anniv.*/, "(25th Anniv. Edition)")}          {any{fn.match(/(?i)remastered/)}{''}.replaceAll(/(?i).*Remastered.*/, "(Remastered)")}           {any{fn.match(/(?i)extended.+?edit/)}{''}.replaceAll(/(?i).*Extended.+?Edit.*/, "(Extended Edition)")}     {any{fn.match(/IMAX.+?Edition/)}{''}.replaceAll(/(?i).*imax.+?edition.*/, "(IMAX Edition)")}             {any{fn.match(/(?i)direct.+?cut/)}{''}.replaceAll(/(?i).*direct.+?cut.*/, "(Director's Cut)")}     {any{fn.match(/(?i)unrated/)}{''}.replaceAll(/(?i).*unrated.*/, "(Unrated)")}     {any{fn.match(/(?i)\(limited.*?\)/)}{''}.replaceAll(/(?i).*limited.*/, "(Limited Edition)")}    {any{fn.match(/(?i)\(uncut.*?\)/)}{''}.replaceAll(/(?i).*uncut.*/, "(Uncut)")}    {any{fn.match(/(?i)collector.+?s.+?edition/)}{''}.replaceAll(/(?i).*collector.+?s.+?edition.*/, "(Collector's Edition)")}                  {any{fn.match(/\([^\()+?[^\d]+?\)\s*/)} {""}{''}}   {self.vf ? self.vf + "" : self.hpi}    {"${self.source ?: 'WEB-DL'}"}    {ac}    {audio[0].channels.replaceAll(/^(\d{1}).*/,'$1')replaceAll(/2/, "2ch").replaceAll(/6/, "5.1ch").replaceAll(/8/, "7.1ch")}    {vc}_{any{"$group"}{fn.match(/(?<=[_-])[^\s_-]+?$/)}{'NA'}.replaceAll(/[-_\[\]]\s*|\.\w{3}$/, "")}/{n.replace(':','-').replaceAll(/[\/:*?"<>|]/,' - ')}    ({y})                   {any{fn.match(/(?i)25th.+?anniv/)}{''}.replaceAll(/(?i).*25th.+?anniv.*/, "(25th Anniv. Edition)")}          {any{fn.match(/(?i)remastered/)}{''}.replaceAll(/(?i).*Remastered.*/, "(Remastered)")}           {any{fn.match(/(?i)extended.+?edit/)}{''}.replaceAll(/(?i).*Extended.+?Edit.*/, "(Extended Edition)")}     {any{fn.match(/IMAX.+?Edition/)}{''}.replaceAll(/(?i).*imax.+?edition.*/, "(IMAX Edition)")}             {any{fn.match(/(?i)direct.+?cut/)}{''}.replaceAll(/(?i).*direct.+?cut.*/, "(Director's Cut)")}     {any{fn.match(/(?i)unrated/)}{''}.replaceAll(/(?i).*unrated.*/, "(Unrated)")}     {any{fn.match(/(?i)\(limited.*?\)/)}{''}.replaceAll(/(?i).*limited.*/, "(Limited Edition)")}    {any{fn.match(/(?i)\(uncut.*?\)/)}{''}.replaceAll(/(?i).*uncut.*/, "(Uncut)")}    {any{fn.match(/(?i)collector.+?s.+?edition/)}{''}.replaceAll(/(?i).*collector.+?s.+?edition.*/, "(Collector's Edition)")}                  {any{fn.match(/\([^\()+?[^\d]+?\)\s*/)} {""}{''}}   {self.vf ? self.vf + "" : self.hpi}    {"${self.source ?: 'WEB-DL'}"}    {ac}    {audio[0].channels.replaceAll(/^(\d{1}).*/,'$1')replaceAll(/2/, "2ch").replaceAll(/6/, "5.1ch").replaceAll(/8/, "7.1ch")}    {vc}_{any{"$group"}{fn.match(/(?<=[_-])[^\s_-]+?$/)}{'NA'}.replaceAll(/[-_\[\]]\s*|\.\w{3}$/, "")}{any{'.'+lang}{lang}}{any{fn.match(/(?i)sdh.+?/)}{''}.replaceAll(/(?i).*sdh.*/, "_SDH")}{any{fn.match(/(?i)\(foreignpartsonly\)/)}{''}}{"."+ext}
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Presets

Post by rednoah »

stephen147 wrote:It's the only way to rename subtitles and movies together
How so? What's the problem?

Extension: Override only allows you to change ".sub" to ".srt". Why would you do that? In fact, you're not even trying to do that. Your format ends with {"."+ext} so you apparently want to keep the extension.
:idea: Please read the FAQ and How to Request Help.
stephen147
Donor
Posts: 131
Joined: 01 Sep 2015, 22:40

Re: Presets

Post by stephen147 »

I'll need to revisit this again when I've time.

It was the only way for me to use them bindings successfully to rename movie and sub files was to have the override extension enabled and then rewrite it back again using {"."+ext}.
kindofblue91
Posts: 3
Joined: 13 Apr 2017, 15:38

Re: Q&A for n00bs

Post by kindofblue91 »

I apologize in advance if this is an easy fix!

So pretty frequently I'm getting a "file is being used" error when uTorrent runs my post-download amc script. To remedy this for now, I've created a scheduled task to run my sort command, to scoop up any files that the post-download script couldn't immediately grab.

My issue is that even if the rename/file transfer errors out with "file is being used", the filename is being written to the exclude list.

So the question is, am I able to setup the script so if Filebot errors out on a file, that file is NOT added to the exclude list?

If that is not possible, is it possible to run the uTorrent post-download script WITHOUT --def excludeList? The scheduled task would still have --def excludeList. Haven't removed that line because of your indication that frequent repeats would constitute a ban from the script.

Thanks so much!

If it helps any, here are my 2 scripts:

uTorrent post-download

Code: Select all

filebot -script fn:amc --output "D:\Plex" --action move --conflict skip -non-strict --log-file amc.log --def "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D" excludeList=amc.txt movieFormat="D:/Plex/Movies/{fn}" seriesFormat="D:/Plex/TV/{fn}"
Scheduled task

Code: Select all

filebot -script fn:amc --output "D:\Plex" --action move --conflict skip -non-strict "C:\Users\username\Downloads" --log-file amc.log --def excludeList=amc.txt movieFormat="D:/Plex/Movies/{fn}" seriesFormat="D:/Plex/TV/{fn}"
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Q&A for n00bs

Post by rednoah »

1.
You can't use --action move on files that are being seeded. My recommendation is to use --action duplicate and to make sure that input/output folder are on the same drive (i.e. your Downloads and Plex folder should be on Drive D:) so that it can create hardlinks instead of having to physically copy the data from one drive to another.

You want to seed files and you want to create an additional file entry (i.e. hardlink) in your Plex folder. That is not a problem. You can have the same file twice (or many times) without using any extra disk space.

@see https://en.wikipedia.org/wiki/Hard_link#Example


2.
If you're using {fn} as format, then I see no reason to use FileBot or the amc script at all actually. There's simpler tools for just moving files into folders. You're using a space ship when you should be using a tractor. :lol:

:idea: If you use Plex on your Plex folder, Plex will definitely not be happy with a flat folder of completely and utterly unorganized files. :lol:

:?: Are you sure you know what {fn} means?
:idea: Please read the FAQ and How to Request Help.
kindofblue91
Posts: 3
Joined: 13 Apr 2017, 15:38

Re: Q&A for n00bs

Post by kindofblue91 »

Thanks for the reply!

I'm using Filebot because I couldn't find a tool to accurately sort Movies/TV Shows on Windows. On Mac, I had a Folder Action set up that performed this nicely (with few errors, it searched the filename for S**E**)
:idea: If you use Plex on your Plex folder, Plex will definitely not be happy with a flat folder of completely and utterly unorganized files. :lol:
Plex doesn't seem to mind unorganized files just sitting in their TV/Movie folder...at least, as far as I can tell! :lol: I just have 2 Plex libraries, one at D:\Plex\Movies & one at D:\Plex\TV.
:?: Are you sure you know what {fn} means?
Yes, using {fn} because I didn't see a need to rename the files.
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Q&A for n00bs

Post by rednoah »

Plex wrote:It's important that your media files and library folders are named and organized
Plex is very explicit about how files must be organized:
https://support.plex.tv/hc/en-us/catego ... reparation
kindofblue91 wrote:Yes, using {fn} because I didn't see a need to rename the files.
You're either insanely lucky, or you just haven't seen much yet. :lol:
:idea: Please read the FAQ and How to Request Help.
kindofblue91
Posts: 3
Joined: 13 Apr 2017, 15:38

Re: Q&A for n00bs

Post by kindofblue91 »

Oh jeez, my TV library would probably give you a hernia, then! My thought process was that once Plex has indexed the library, it wouldn't really care that all episodes aren't grouped in a series-named sub-folder :?

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

Re: Q&A for n00bs

Post by rednoah »

Sure, but to correctly index your library, it needs to make sense first. With flat files like this, it might work sometimes, maybe even most of the time, but certainly not all the time. :D
:idea: Please read the FAQ and How to Request Help.
kaziekama
Posts: 1
Joined: 23 Apr 2017, 22:02

syntax error near unexpected token `('

Post by kaziekama »

Command:

Code: Select all

filebot -rename *.mkv --output /mydir --format {n}/{episode.special ? "Specials" : "Season "+s.pad(2)}/'{n} - {episode.special ? "S00E"+special.pad(2) : s00e00} - {t}' --db TheTVDB
Error:

Code: Select all

syntax error near unexpected token `('
-script fn:sysinfo

Code: Select all

FileBot 4.7.9 (r4984)
JNA Native: 5.1.0
MediaInfo: 0.7.73
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2017-04-03 (r494)
Groovy: 2.4.10
JRE: Java(TM) SE Runtime Environment 1.8.0_65
JVM: 32-bit Java HotSpot(TM) Client VM
CPU/MEM: 4 Core / 224 MB Max Memory / 12 MB Used Memory
OS: Linux (arm)
Package: DEB
Data: /---/---/.filebot
uname: Linux ---4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l GNU/Linux
I'm pulling my hair out with this. I really could use an extra set of eyes on my script call.
Santaspascuas
Posts: 2
Joined: 24 Apr 2017, 13:50

Re: [Mac] Folder Action with Automator

Post by Santaspascuas »

Hi,

I have followed all your steps, and when I run the Automator I get the following error message: "Illegal usage: output folder must exist and must be a directory: "Media".

I have a folder called Media (users/alvaro/Media) *alvaro is my name
Can you help me with this issue? It is my first time writing scripts and I have no clue of the proper spelling of the output route.
Thanks!
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Mac] Folder Action with Automator

Post by rednoah »

Thanks for the post! Before a real human comes by, please make sure your report has all the following points checked:
  • What are you trying to do achieve? What's not working? What have you tried so far?
  • Include screenshots, logs or filenames (i.e. demonstrate the issue)
  • Include basic information (i.e. sysinfo output)
:idea: Please read How to Request Help and Fix Problems, Report Bugs, Get Features
:idea: Please read the FAQ and How to Request Help.
Laynezilla
Posts: 1
Joined: 25 Apr 2017, 04:27

Re: --filter and fine-tuning

Post by Laynezilla »

Is there a complete list of filters anywhere?
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: --filter and fine-tuning

Post by rednoah »

:idea: The number of possible filters is infinite. The available bindings (n, y, s, etc) are the same as in format expressions.

What's the problem? What are you trying to accomplish?
:idea: Please read the FAQ and How to Request Help.
Santaspascuas
Posts: 2
Joined: 24 Apr 2017, 13:50

Re: [Mac] Folder Action with Automator

Post by Santaspascuas »

Hi rednoah, apologies for the lousy help request. I have now read the FAQ and the How to Request Help section. I am sorry if I still make mistakes, because I am not English fluent and I dont understand many of the words and instructions. Here I go:
I am running automator on a Mac Mini, runnin OS Sierra 10.12.4.
I am trying to set Automator to look up the destination folder of Transmission (called "Transmission"), where all the movies and tvshows are dowloaded, and process the media files through Filebot to rename them and send them to the Media folder.
Hopefully, in a second stage I would like to send the renamed files to external hard drives and even get the subtitles, but I dont want to bother you even further.
I have installed the filebot console tools and checked that are working.
When I follow the instructions given by you in this post, I open Automator, I select new Document and select Folder Action.
I click the Choose folder combobox and select the folder "Transmission"
When I paste the shell script arguments exactly as you say ("$HOME/Media"), I get the following error: http://i.imgur.com/ALOgN6r.png
If I write another route (/Users/alvaro/Media), the message is similar (quoting and unquoting): http://i.imgur.com/CAHmOX6.png

I hope I've provided enough information.
Many thanks in advance!
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Mac] Folder Action with Automator

Post by rednoah »

:!: It's a very bad idea to watch active download folders for changes. This could not possibly end well.

The best solution is to have Transmission call FileBot on completed downloads. Here's the setup instructions for that:
viewtopic.php?f=4&t=215#p3380
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Exclude Blacklist & Series-Mappings

Post by kim »

FS
I use FS (FullScreen) just like WS is for WideScreen
it's mostly a movie thing
or it gets used like so search/movie?query=*****+****+fs
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

kim wrote: 18 Jun 2017, 00:23 FS
I use FS (FullScreen) just like WS is for WideScreen
it's mostly a movie thing
or it gets used like so search/movie?query=*****+****+fs
Please give me 1 or more example file names / paths I can test with.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Exclude Blacklist & Series-Mappings

Post by kim »

Query Blacklist:
1.0 (e.g. MP3.1.0)
2.0 (e.g. AC3.2.0)
divx5 (Codec)
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

I'll need the filename for testing please.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Exclude Blacklist & Series-Mappings

Post by kim »

that was ok, but need one more
DTS.2.0

so:
(DTS|FLAC|AAC|AC3|MP3|MP4|DD|MA).?[12457][.]?[01]

some with DivX3 and DivX4

so:
DivX[345]?


btw:
do the DVDRip not need to be BEFORE the DVD to work ?
DVD|DVD5|DVD9|DVDRip

it does when I test on http://regexr.com/
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

FileBot will require word boundaries for each match. Then the regex FileBot effectively uses would look more like this:

Code: Select all

\b(DVD|DVD5|DVD9|DVDRip)\b
:idea: Please read the FAQ and How to Request Help.
garyleecn
Donor
Posts: 114
Joined: 19 Nov 2014, 03:48

Re: [SNIPPET] Override / Hardcode Series Names

Post by garyleecn »

so how do I integrate it with AMC?
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [SNIPPET] Override / Hardcode Series Names

Post by rednoah »

You pass in your own format. The amc manual has a section on how to use custom formats.
:idea: Please read the FAQ and How to Request Help.
timpan195
Posts: 1
Joined: 02 Aug 2017, 09:02

Re: Q&A for n00bs

Post by timpan195 »

I'm having an issue with running this through powershell, it simply picks the first hit on a movie, the same applies for series.
Is there any way for me to either let me pick which movie / series is or at least have it skip those files since it messes up my library.
I have been testing this out using Red Dawn, both the 1984 version and the 2012 version but both gets placed as the 1984 version.
It names and places the files correctly if they have the year in the name i.e. "Red Dawn (2012).mp4".

Code:

Code: Select all

cd "D:\Google Download Stuff\Series\"
get-childItem 'D:\Google Download Stuff\Series\*.mp4' | filebot -non-strict -rename '*' --db TheTVDB --conflict auto --filter "'s' - 'e'" --format 'D:/Google Download Stuff/Media/Series/{plex[1]} ({y})/Season {s}/{plex.name}' --output 'By Series' --mode interactive
cd "D:\Google Download Stuff\Movies\"
<This section>
get-childItem 'D:\Google Download Stuff\Movies\*.mp4'| filebot -non-strict -rename '*' --mode interactive --db TheMovieDB --conflict auto --format 'D:/Google Download Stuff/Media/Movies/{n0 = n.charAt(0); n0.isDigit() ? "0-9" : n0}/{plex[1]}/{plex.name}' --output 'By First Letter'
</This section>
pause
Below example is with "Red Dawn (2012).mp4" renamed to "Red Dawn.mp4"

Code: Select all

D:\Google Download Stuff>PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& 'D:\Google Download Stuff\Scripts\Move.ps1'"

<Ignore this, Series folder is empty>
Illegal Argument: java.nio.file.InvalidPathException: Illegal char <*> at index 0: * (*)
Rename episodes using [TheTVDB]
No media files: [*]
Failure (°_°)
</Ignore this, Series folder is empty>

Rename movies using [TheMovieDB]
Auto-detect movie from context: [D:\Google Download Stuff\Movies\Red Dawn.mp4]
[MOVE] from [D:\Google Download Stuff\Movies\Red Dawn.mp4] to [D:\Google Download Stuff\Media\Movies\R\Red Dawn (1984)\R
ed Dawn (1984).mp4]
Processed 1 files
Press Enter to continue...:
Image
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Q&A for n00bs

Post by rednoah »

If you're processing badly named files, make sure to try things with --action test first. Here's how I'd deal with this particular file.

Command:

Code: Select all

filebot -rename --db TheMovieDB *.mp4 --filter "y > 2000"
Output:

Code: Select all

Rename movies using [TheMovieDB]
Auto-detect movie from context: [Red Dawn.mp4]
Apply filter [y > 2000] on [12] items
Include [Red Dawn (2012)]
Include [Red Dawn (2011)]
Include [Red (2008)]
Include [Red (2002)]
Include [RED (2010)]
Include [Rockin' at the Red Dog: The Dawn of Psychedelic Rock (2005)]
Include [Assembly (2007)]
[MOVE] from [Red Dawn.mp4] to [Red Dawn (2012).mp4]
Processed 1 files
:idea: Please read the FAQ and How to Request Help.
kyoobix
Posts: 1
Joined: 09 Aug 2017, 12:40

Re: Q&A for n00bs

Post by kyoobix »

Hello Forum,

Since I'm new here, I think the n00b section might be the right place for my question.




No matter what I try, I cannot get deluge to run any scripts. I have created a bat file and placed in my documents folder. When executede manually everything works without any problems. But how do i get Deluge to execute my script or my bat-file?

I have tried pasting the script execute-plugin without any luck. Also I have tried putting in a full path for the bat file. C:\users\username\documents\execute.bat. With and without qoutation marks. Also without any luck. How do I get Deluge on windows to execute filebot cmd's after completet download?

Notes
Filebot is up to date.
Deluge is 1.3.15
OS is Windows 10
Cutha
Posts: 13
Joined: 21 Aug 2017, 09:16

Re: How about sharing our format expressions?

Post by Cutha »

The man hours or more like man days that I have could have saved if I had known about filebot! Fantastic tool and community.

I started using filebot a few days ago and quickly ran into a problem with naming my files based on audio stream. Turns out some of my movies do not have the best track set to the default and/or to audio[0]. I noticed others on here also wanting to have the "best" audio shown in the file name, or at least tag it with Atmos or DTS-X if it had it.

Once I started working with it I couldn't stop until I had it the way I wanted. Crouching Tiger has DTS 6Ch English on audio[0] and it is set as the default and Atmos is on [3]. I also decided to do a best audio option based on my own scale where object based sound gets a score of 10, DTS-HD MA gets a score of 20 and
AAC gets 50. I haven't fully fleshed this out.

The primary goal was to get the audio track that is set as default, which may not be [0] and use that for the file name. I also wanted to make sure my Atmos movies got tagged as such even if the Atmos track was not set as default.

Example where DTS is set as default but Atmos is available and where DTS-X is the default.

Crouching Tiger, Hidden Dragon (2000) DTS-HDMA 6Ch [Best Available TrueHD(Atmos) OB+8Ch]
The Huntsman - Winter's War (2016) DTS-HDMA(DTS-X) OB+8Ch

Image

It iterates through all the audio channels, scores them and based on that makes the string for the audio part of the file name. It's my first Groovy code so I apologize if its not the most efficient.

I fixed a few things and instead of making another post I changed it here:

Code: Select all

{
def sPath = "";
def mHDRCol = ["BT.709" : "NO", "BT.2020" : "YES"];
def mWebSrc = ["AMZN" : "AMZN", "NF" : "NF", "HBO" : "HBO"];
def hiResPath = "";
boolean isHDR = false;

if(self.video[0].bitdepth != null && self.bitdepth >= 10 && self.video[0].colourprimaries != null &&  mHDRCol.get(self.video[0].colourprimaries) == "YES") isHDR = true;

if(vf =~ /2160p/) hiResPath = '4k/' + video[0].Format.replace('AVC', 'x264').replace('HEVC', 'x265');
if(isHDR == true){ hiResPath += "(HDR)/" } else {hiResPath += "/"};

def VInfo = " - (FI " + vf + " ";
mWebSrc.any { k, v -> if(f.toString().contains(k))  VInfo += v + " "};

if(self.source =~ 'Remux') VInfo += fn.match(/BluRay/) else if(self.source != null) VInfo += self.source;

VInfo += " [" + video[0].Format.replace('AVC', 'x264').replace('HEVC', 'x265');
VInfo += " ";

if(isHDR == true) VInfo += " HDR " + self.bitdepth + "bit ";
if(isHDR == true && self.video[0].colourprimaries != null) VInfo += self.video[0].colourprimaries.replace(".","") + " ";
VInfo += "]";

sPath + hiResPath  + plex + VInfo;

}

{def ADef = 0;
def ADefScore = 100;
def ACurrent = 100;
def ABest = 100;
def ABestIndex;
def ACnt = audio.size;
def iCnt = 0;

//map of scoring, Codec + FormatProfile with '+' and '/' stripped
def mAudioScore =[
"DTS-HDXMACore" : 10, "DTS-HDMACore" : 20, "DTS-HDMAES MatrixCore" : 20, "DTSES DiscreteCore" : 25, "DTS" : 30,  "DTS-HDHRACore" : 25,
"TrueHDTrueHDAtmosTrueHD" : 10, "TrueHD" : 18, 
"AC3" : 30, "AC3+" : 20, "AAC" : 50, "AAC LCLC" : 45, "AAC LC-SBRHE-AACLC" : 40,
"MPA1L3Layer 3" : 60, "MPA1L2Layer 2" : 70,
"Vorbis" : 65,
"PCM" : 90, "Qclp" : 90, "161" : 90];

//map of Codec + FormatProfile made nice for file name
def mAFP = [ 
"DTS-HDXMACore" : "DTS-HDMA(DTS-X)", "DTS-HDMACore" : "DTS-HDMA", "DTS" : "DTS",  "DTS-HDMAES MatrixCore" : "DTS-HDMA",  "DTSES DiscreteCore" : "DTS-ES", "DTS-HDHRACore" : "DTS-HDHRA",
"TrueHDTrueHDAtmosTrueHD" : "TrueHD(Atmos)", "TrueHD" : "TrueHD", 
"AC3" : "AC3", "AC3+" : "DDP", 
"AAC LCLC" : "AAC", 
"MPA1L3Layer 3" : "MP3", "MPA1L2Layer 2" : "MP2",
"PCM" : "PCM", "Qclp" : "Qclp", "161" : "161"];

//map of Audio Channels(minus the slash) to pretty name
def mACH = [ 
"Object Based10" : "OB+10Ch", 
"Object Based8" : "OB+8Ch", "Object Based86" : "OB+8Ch", 
"Object Based6" : "OB+6Ch", 
"Object Based" : "OBCh", 
"9" : "9Ch", 
"8" : "8Ch", "86" : "8Ch",  "876" : "8Ch",
"7" : "7Ch", "76" : "7Ch",
"6" : "6Ch", 
"5" : "5Ch", 
"4" : "4Ch", "3" : "3Ch", "2" : "2Ch", "1" : "1Ch" ];

//Intermederia used to make finding missing strings from the maps
def CmACH = { if(mACH.get(it) != null) mACH.get(it) else " (mACH:" + it + " NOT FOUND)"};
def CmAFP = { if(mAFP.get(it) != null) mAFP.get(it) else " (mAFP:" + it + " NOT FOUND)"};
def CmAudioScore = { if(mAudioScore.get(it) != null) mAudioScore.get(it) else " (mAudioScore:" + it + " NOT FOUND)"};

//simple functions for creating audio text for file name
def GetFPSafe = {if(self.audio[it].FormatProfile != null) audio[it].FormatProfile.slash('').replace("+","") else ""};
//def GetAText = {mAFP.get( audio[it].codec + GetFPSafe(it)) + " " + mACH.get( audio[it].channels.slash('') ) };
def GetAText = {CmAFP( audio[it].codec + GetFPSafe(it)) + " " + CmACH( audio[it].channels.slash('') ) };

//Get index # that the default audio is using (only expecting 1 default audio)
audio.eachWithIndex{ a, idx -> if(call{a.default} == "Yes") ADef = idx};
//Get score for default audio
ADefScore = CmAudioScore(self.audio[ADef].codec + GetFPSafe(ADef))
//ADefScore = 50; //for your testing

//Check all audio streams, rank them against one another, get best score
for (iCnt = 0; iCnt < ACnt; iCnt++){

ACurrent = CmAudioScore(self.audio[iCnt].codec + GetFPSafe(iCnt))
if(ACurrent != null && ACurrent.toInteger() < ABest) ABestIndex = iCnt;
if(ACurrent != null && ACurrent.toInteger() < ABest) ABest = ACurrent.toInteger();
};

//end
if(ADefScore.toInteger() == ABest) GetAText(ABestIndex) + ")" else GetAText(ADef) + " [BA " + GetAText(ABestIndex) + "]" + ")";
}


And my little piece of code for HDR. As I learn more about HDR I will add more logic.

Code: Select all

{
def mHDRCol = ["BT.709" : "NO", "BT.2020" : "YES"];
if(bitdepth >= 10 &&  mHDRCol.get(self.video[0].colourprimaries) == "YES" ) '(HDR)/' else '(NonHDR)/';
}
Last edited by Cutha on 22 Aug 2017, 10:44, edited 4 times in total.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: How about sharing our format expressions?

Post by kim »

I like your "score" idea, but it has problems:
e.g.
DTS-HDMA (mACH:86 NOT FOUND))
and extra
+ ")"
here is my audio format:

Code: Select all

{
def ChannelString = any{(0.0+audio.'ChannelPositionsString2'*.replaceAll(/Object\sBased\s\/|0.(?=\d.\d)/, '')*.split(' / ')*.collect{ it.split('/')*.toBigDecimal().sum() }*.max().max()).toString()}{channels};
def codecSubVersion = any{audio.any{ a -> call{a.FormatProfile} =~ 'HRA' } ? '.HRA' : null}{audio.any{ a -> call{a.FormatProfile} =~ 'MA / Core' } ? '.MA' : null}{audio.any{ a -> call{a.FormatProfile} =~ 'ES Matrix / Core' } ? '-ES' : null}{null};
def codecVersion = any{audio.Codec.join().match(/DTS-HD/)+codecSubVersion+'.'+audio.Codec.join().match(/TrueHD/)}{audio.Codec.join().match(/DTS-HD/)+codecSubVersion}{audio.Codec.join().match(/TrueHD/)}{audio.Codec.join().match(/DTS/)+codecSubVersion.replaceAll(/null/)}{ac};
(allOf{'.'+codecVersion.replaceAll(/null/)}
{if( ((ac == 'AAC'||ac == 'MP3') && (channels != '2.0' || ChannelString != channels) ) || ( (ac == 'AC3'||ac == 'DTS'||ac == 'TrueHD') && (channels != '5.1' || ChannelString != channels) ) ) return {any{ChannelString}{channels}}}
{aco.match(/Atmos/)}).join('.')
}
Cutha
Posts: 13
Joined: 21 Aug 2017, 09:16

Re: How about sharing our format expressions?

Post by Cutha »

I just ran it through some of my old collection to find the old codec stuff and then I ran it against my 4k collection and I found some surprises.

I knew I wouldn't capture all the possibilities off the start so I made it so it would be kind of easy to track down what is missing.

(mACH:86 NOT FOUND)) is because in the map for audio channels "mACH" I didn't have the "8/6", if you add "86" : "8Ch" to it then it should work. I updated it like this:

Code: Select all

//map of scoring, Codec + FormatProfile with + and / stripped
def mAudioScore =[ "DTS-HDXMACore" : 10, "DTS-HDMACore" : 20, "DTS" : 30, "TrueHDTrueHDAtmosTrueHD" : 10, "TrueHD" : 18, "AC3" : 40, "AAC" : 50, "AAC LCLC" : 50, "MPA1L3Layer 3" : 60,"MPA1L2Layer 2" : 70];
//map of Codec + FormatProfile made nice for file name
def mAFP = [ "DTS-HDXMACore" : "DTS-HDMA(DTS-X)", "DTS-HDMACore" : "DTS-HDMA", "DTS" : "DTS", "TrueHDTrueHDAtmosTrueHD" : "TrueHD(Atmos)", "TrueHD" : "TrueHD", "AC3" : "AC3", "AAC LCLC" : "AAC", "MPA1L3Layer 3" : "MP3", "MPA1L2Layer 2" : "MP2" ];
//map of Audio Channels(minus the slash) to pretty name
def mACH = [ "Object Based10" : "OB+10Ch", "Object Based8" : "OB+8Ch", "Object Based86" : "OB+8Ch", "Object Based6" : "OB+6Ch", "Object Based" : "OBCh", "9" : "9Ch", "8" : "8Ch", "86" : "8Ch", "7" : "7Ch", "6" : "6Ch", "5" : "5Ch", "4" : "4Ch", "3" : "3Ch", "2" : "2Ch", "1" : "1Ch" ];
For the HDR stuff I just found that Elysium, at least the version that I grabbed, doesn't have a .bitdepth field.

Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Codec ID : V_MPEGH/ISO/HEVC
Duration : 1 h 49 min
Bit rate : 57.7 Mb/s
Width : 3 840 pixels
Height : 1 608 pixels
Display aspect ratio : 2.40:1
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Bits/(Pixel*Frame) : 0.390
Stream size : 44.2 GiB (86%)
Language : English
Default : Yes
Forced : No


To prevent it from completely dying I did this:

Code: Select all

if(self.video[0].bitdepth != null && self.bitdepth == 10 && self.video[0].colourprimaries != null &&  mHDRCol.get(self.video[0].colourprimaries) == "YES") isHDR = "YES";
Cutha
Posts: 13
Joined: 21 Aug 2017, 09:16

Re: How about sharing our format expressions?

Post by Cutha »

kim wrote: 21 Aug 2017, 14:38 here is my audio format:
Yours works well with my Atmos and everything else but it does not identify the other object based format, DTS-X.

It displayed this:
.DTS-HD.MA.7.1

For this:
Format_Profile X / MA / Core
CodecID A_DTS
Codec DTS-HD
Codec/String DTS-HD
Codec/Family DTS
Duration 7210454.000000
BitRate_Mode VBR / VBR / CBR
BitRate_Mode/String Variable / Variable / Constant
BitRate 3840000 / 3840000 / 1509000
BitRate/String 3 840 kb/s / 3 840 kb/s / 1 509 kb/s
Channel(s) Object Based / 8 / 6
Channel(s)/String Object Based / 8 channels / 6 channels
ChannelPositions Object Based / Front: L C R, Side: L R, Back: L R, LFE / Front: L C R, Side: L R, LFE
ChannelPositions/String2 Object Based / 3/2/2.1 / 3/2/0.1
ChannelLayout Object Based / / C L R Ls Rs LFE
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: How about sharing our format expressions?

Post by kim »

that's because I don't any X-files:P
you can just add it like this:

Code: Select all

{
def ChannelString = any{(0.0+audio.'ChannelPositionsString2'*.replaceAll(/Object\sBased\s\/|0.(?=\d.\d)/, '')*.split(' / ')*.collect{ it.split('/')*.toBigDecimal().sum() }*.max().max()).toString()}{channels};
def codecSubVersion = any{audio.any{ a -> call{a.FormatProfile} =~ 'HRA' } ? '.HRA' : null}{audio.any{ a -> call{a.FormatProfile} =~ 'X / MA / Core' } ? '.X' : null}{audio.any{ a -> call{a.FormatProfile} =~ 'MA / Core' } ? '.MA' : null}{audio.any{ a -> call{a.FormatProfile} =~ 'ES Matrix / Core' } ? '-ES' : null}{null};
def codecVersion = any{audio.Codec.join().match(/DTS-HD/)+codecSubVersion+'.'+audio.Codec.join().match(/TrueHD/)}{audio.Codec.join().match(/DTS-HD/)+codecSubVersion}{audio.Codec.join().match(/TrueHD/)}{audio.Codec.join().match(/DTS/)+codecSubVersion.replaceAll(/null/)}{ac};
(allOf{'.'+codecVersion.replaceAll(/null/)}
{if( ((ac == 'AAC'||ac == 'MP3') && (channels != '2.0' || ChannelString != channels) ) || ( (ac == 'AC3'||ac == 'DTS'||ac == 'TrueHD') && (channels != '5.1' || ChannelString != channels) ) ) return {any{ChannelString}{channels}}}
{aco.match(/Atmos/)}).join('.')
}
result = .DTS-HD.X.7.1
feel free to edit it if you like it an other way ;)

e.g. like this:

Code: Select all

{
def ChannelString = any{(0.0+audio.'ChannelPositionsString2'*.replaceAll(/Object\sBased\s\/|0.(?=\d.\d)/, '')*.split(' / ')*.collect{ it.split('/')*.toBigDecimal().sum() }*.max().max()).toString()}{channels};
def codecSubVersion = any{audio.any{ a -> call{a.FormatProfile} =~ 'HRA' } ? '.HRA' : null}{audio.any{ a -> call{a.FormatProfile} =~ 'X / MA / Core' } ? '-X' : null}{audio.any{ a -> call{a.FormatProfile} =~ 'MA / Core' } ? '.MA' : null}{audio.any{ a -> call{a.FormatProfile} =~ 'ES Matrix / Core' } ? '-ES' : null}{null};
def codecVersion = any{audio.Codec.join().match(/DTS-HD/)+codecSubVersion+'.'+audio.Codec.join().match(/TrueHD/)}{audio.Codec.join().match(/DTS-HD/) && codecSubVersion == '-X' ? 'DTS-X' : null}{audio.Codec.join().match(/DTS-HD/)+codecSubVersion}{audio.Codec.join().match(/TrueHD/)}{audio.Codec.join().match(/DTS/)+codecSubVersion.replaceAll(/null/)}{ac};
(allOf{'.'+codecVersion.replaceAll(/null/)}
{if( ((ac == 'AAC'||ac == 'MP3') && (channels != '2.0' || ChannelString != channels) ) || ( (ac == 'AC3'||ac == 'DTS'||ac == 'TrueHD') && (channels != '5.1' || ChannelString != channels) ) ) return {any{ChannelString}{channels}}}
{aco.match(/Atmos/)}).join('.')
}
result = .DTS-X.7.1

BTW: what is the standard naming of DTS:X files ?
Cutha
Posts: 13
Joined: 21 Aug 2017, 09:16

Re: How about sharing our format expressions?

Post by Cutha »

kim wrote: 21 Aug 2017, 17:24 result = .DTS-X.7.1

BTW: what is the standard naming of DTS:X files ?
I only have a couple movies and they were both .DTS-X. so I assume thats what it is. I tried to google it but all I could find was stuff about WEBRip and that sort as far as naming goes.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: How about sharing our format expressions?

Post by kim »

well then you can just copy/paste my format then ;)
Cutha
Posts: 13
Joined: 21 Aug 2017, 09:16

Re: How about sharing our format expressions?

Post by Cutha »

The sharing is great, the more knowledge the better. I am partial to knowing in the file name what the properties of the 'default' audio track and if there is a better track available. Because of that I check each audio track.
Effe
Posts: 1
Joined: 15 Sep 2017, 10:05

Re: [JDownloader] Setup for Windows, Linux and Mac OS X

Post by Effe »

I need help with this script.

I followed the guide, I get no error, but the files are not renamed.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Exclude Blacklist & Series-Mappings

Post by kim »

with this in filename e.g.
DTS-MA.5.1
it still use this to lookup movie
+5+1
also what about 1, 4 and 8ch + DTS-ES, DTS-HD-HRA and DTS-X + without separator e.g. DTSHD ?

will match e.g. AAC.51 ?
[12457][.]?[01]
to [12457]\.[01]
if so change to something like this:
\b(FLAC|AAC|AC3|MP3|MP4|DTS|DD|TrueHD|Atmos)(.?HD)?(.?ES|.?MA|.?X|.?HRA)?(.?[12457]\.[01])?\b|\b[12468]ch\b
this is how filebot see it, yes (with the \b) ?

btw: I have never seen e.g. 0720p (no?), m720p (yes)
[M0]?(720|1080)[pi]
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

Do you have an example filename for me so I can test the existing patterns and the ones you suggest?
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Exclude Blacklist & Series-Mappings

Post by kim »

new format:
\b(FLAC|AAC|AC3|MP3|MP4|DTS|DD[P+]?|TrueHD|Atmos)(.?HD)?(.?ES|.?MA|.?X|.?HRA)?(.?[124567][.]?[01])?\b|\b[124678]ch\b|\b[2|3]?Audio\b|\bDualAudio\b
test on:
some.movie.2000.DTS.MA.5.1
some.movie.2000.DTS.MA.7.1
some.movie.2000.DTS.MA.6ch
some.movie.2000.DTS-HD.MA.5.1
some.movie.2000.DTS-HD.MA.7.1
some.movie.2000.DTS-HD.MA.6ch
some.movie.2000.DTS-HD.MA.8ch
some.movie.2000.DTSHDMA.5.1
some.movie.2000.DTSHDMA.7.1
some.movie.2000.DTS-X.5.1
some.movie.2000.DTS-X.7.1
some.movie.2000.DTS-X.6ch
some.movie.2000.DTS-X.8ch
some.movie.2000.DTS-HD-HRA.7.1
some.movie.2000.DTS-ES.6.1
some.movie.2000.DTS.1.0
some.movie.2000.DTS.2.0
some.movie.2000.DTS.5.1
some.movie.2000.DTS.6.1
some.movie.2000.DTS.7.1
some.movie.2000.DTS.1ch
some.movie.2000.DTS.2ch
some.movie.2000.DTS.6ch
some.movie.2000.DTS.7ch
some.movie.2000.DTS.8ch
some.movie.2000.DTS

some.movie.2000.DTSMA.2Audio
some.movie.2000.DTS.Audio
some.movie.2000.Dtshd Audio
some.movie.2000.Dts Dualaudio
some.movie.2000.DTSES6.1.3Audio
some.movie.2000.AC3.2Audio
some.movie.2000.FLAC.DD51.DualAudio

some.movie.2000.TrueHD.5.1
some.movie.2000.TrueHD.7.1

some.movie.2000.TrueHD.Atmos.5.1
some.movie.2000.TrueHD.Atmos.7.1
some.movie.2000.DTS-HD.TrueHD.7.1.Atmos

some.movie.2000.AC3.1.0
some.movie.2000.AC3.2.0
some.movie.2000.AC3.4.0
some.movie.2000.AC3.5.1
some.movie.2000.AC3.1ch
some.movie.2000.AC3.2ch
some.movie.2000.AC3.4ch
some.movie.2000.AC3.6ch

some.movie.2000.DD.1.0
some.movie.2000.DD.2.0
some.movie.2000.DD.4.0
some.movie.2000.DD.5.1
some.movie.2000.DDP.1.0
some.movie.2000.DDP.2.0
some.movie.2000.DDP.4.0
some.movie.2000.DDP.5.1
some.movie.2000.DD+.1.0
some.movie.2000.DD+.2.0
some.movie.2000.DD+.4.0
some.movie.2000.DD+.5.1
some.movie.2000.DDP1.0
some.movie.2000.DDP2.0
some.movie.2000.DDP4.0
some.movie.2000.DDP5.1

some.movie.2000.DD.5.1
some.movie.2000.DD.7.1

some.movie.2000.MP3.1.0
some.movie.2000.AAC.5.1
NEW:
DDP = DD+ = Dolby Digital Plus
"Audio Channels: 1.0 to 13.1"
https://en.wikipedia.org/wiki/Dolby_Digital_Plus
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Exclude Blacklist & Series-Mappings

Post by kim »

have you tested it yet ?
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

No. This one will require a little bit of time and testing. It's on my backlog for the weekend though.

EDIT:

Implemented but not tested for regression issues.
:idea: Please read the FAQ and How to Request Help.
ironcity1861
Posts: 3
Joined: 08 Aug 2016, 18:23

Re: [SNAP] Grant access to /media

Post by ironcity1861 »

only 25 minutes after a reinstall I realized this is why it wasn't working!
b0ssem
Posts: 17
Joined: 20 Mar 2017, 07:56

Re: Q&A for n00bs

Post by b0ssem »

Hey guys,

I have been using Filebot for some time now but only drag and drop style. So now im moving on to the automated worlds. Please bear with me.

I have started off gently by creating a .bat-file that gets run atomatically when my files get extracted by another software im using. So when the extraction is complete is calls the .bat-script and executes the line below.

This is what i have started out with

Code: Select all

filebot -script fn:amc --output "N:\Done" --action copy -non-strict "N:\TV-IN" --log-file amc.log --def skipExtract=y --def excludeList=amc.txt
Kinda simple, nothing fancy. But there is a few things here that im wondering over.

1. Can I define the script to use any of my presets I have made in Filebot? Some of my swedish TV-Shows get named in english. I want them in Swedish. At the moment i have 2 presets. TV and Movie.

2. Is it possible to make the script to copy the files directly to N:\Done\TV Shows. Instead of how its doing now N:\Done\Tv Shows\ Tvshowname\Season13\

I think that will be good for now.

Thanks in advanced!
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Q&A for n00bs

Post by rednoah »

1.
Yes, you can set custom formats and language preferences via command-line options.

2.
I think you're talking about a custom format that might look something like this:

Code: Select all

N:\Done\{plex.name}
:idea: Please read the FAQ and How to Request Help.
b0ssem
Posts: 17
Joined: 20 Mar 2017, 07:56

Re: Q&A for n00bs

Post by b0ssem »

rednoah wrote: 05 Oct 2017, 20:10 1.
Yes, you can set custom formats and language preferences via command-line options.

2.
I think you're talking about a custom format that might look something like this:

Code: Select all

N:\Done\{plex.name}
Thanks for you fast reply!

I will check up on the custom formats and language.

Regarding the custom formats, I did a little test and edited my line as you proposed.

Code: Select all

filebot -script fn:amc --output "N:\Done\{plex.name}" --action copy -non-strict "N:\TV-IN" --log-file amc.log --def skipExtract=y --def excludeList=amc.txt
But i got this error when running
Illegal usage: output folder must exist and must be a directory: N:\Done\{plex.name}
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Q&A for n00bs

Post by rednoah »

1.
--output and --format have distinctively different meanings and functions.

e.g.

Code: Select all

-rename --output N:\Done --format {plex.name}
@see https://www.filebot.net/cli.html


2.
Since you're using the amc script, you'll want to read Change how files will be organized and renamed because you'll need to pass in a custom format for each media type via the --def <type>Format options.
:idea: Please read the FAQ and How to Request Help.
dadelayer
Posts: 5
Joined: 06 Oct 2017, 06:18

Re: Batch Rename any type of file

Post by dadelayer »

Thanks!. I tested it out using the example and it worked fine. However, when I use it with my XML file (I converted the JSON > XML), it says my format is not correct.
I use the same format and code as the example
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Batch Rename any type of file

Post by rednoah »

The example here is very specific. You can learn from it, but you can't copy-and-paste and expect it to work in your case. ;)

If you start by learning how to parse JSON, then you're on the right track:
http://docs.groovy-lang.org/latest/html ... urper.html

:idea: You can hire me though, but you'd need to write down exactly what you need, with examples and example data.
:idea: Please read the FAQ and How to Request Help.
dadelayer
Posts: 5
Joined: 06 Oct 2017, 06:18

Re: Batch Rename any type of file

Post by dadelayer »

Well, I wanted to try it in XML since I wanted to use your example, but not coming up with anything.

Code: Select all

def fnn = fn
xml = new XmlSlurper().parse(folder+'/mov.xml')
xml.'**'.find { it.name() == 'scid' && it.text() == fnn}*.parent()*.title*.text()
that should return the title but it's not working as its supposed to. I don't have the money to hire :\ it seems expensive :(
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Batch Rename any type of file

Post by rednoah »

Just debug step by step. Does it parse? Is the first element what you think it should be?

You can prototype and debug these things in the Format Editor in minutes. Just try things and narrow down which exact piece of code isn't working as expected. ;)
:idea: Please read the FAQ and How to Request Help.
brunorene
Posts: 5
Joined: 21 Oct 2017, 18:57

Re: [SNAP] Grant access to /media

Post by brunorene »

I have a NAS mounted using cifs and Im not able to access the files on it... Is that possible?

Im using

/etc/fstab with the config

Code: Select all

//192.168.1.14/nas /media/nas cifs uid=user,gid=user,iocharset=utf8,file_mode=0660,dir_mode=0770,username=username,password=password 0 0
I have already tried --devmode
and

Code: Select all

sudo snap connect filebot:removable-media
sudo snap connect filebot:network
sudo snap connect filebot:network-bind
Regards
Delmano
Posts: 1
Joined: 14 Oct 2017, 10:27

Re: Batch Rename any type of file

Post by Delmano »

This is so useful. Thanks for the tutorial Noah, helps newbies like me a lot.
yodaspowart
Posts: 16
Joined: 02 Jun 2017, 01:04

Re: How about sharing our format expressions?

Post by yodaspowart »

Have a basic script that uses the groovy setup for 4K content going into its own folder for Movies 4K & TV Shows 4K based on 2160p in file name else it goes to regular folders:

Code: Select all

#!/bin/bash

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"

TORRENT_PATH="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
TORRENT_NAME="$TR_TORRENT_NAME"
TORRENT_LABEL="N/A"

# Subtitle language
SUBLANG=en
SKIP_EXTRACT=n
MUSIC=y

filebot -script /opt/filebot/scripts/amc.groovy \
    --output "$HOME/media" \
    -non-strict --encoding utf8 --log all --log-file amc-transmission.log --action copy --conflict override \
    --def artwork=false ut_kind=multi "ut_dir=$TORRENT_PATH" "ut_title=$TORRENT_NAME" subtitles=$SUBLANG \
    --def "movieFormat={fn =~ /2160p/ ? 'Movies 4K' : 'Movies'}/{n} ({y})/{n} {hd} {vc} {vf} ({y}){' CD'+pi}{'.'+lang}" \
    --def "seriesFormat={fn =~ /2160p/ ? 'TV Shows 4K' : 'TV Shows'}/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {hd} - {vc} - {vf} - {t.replaceAll(/[\`´''ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part \$1')}{'.'+lang}" \
    extractFolder="$HOME/files/_extracted" music=$MUSIC skipExtract=$SKIP_EXTRACT &
Thinking of expanding this to Movies 3D, just need to figure out how to do an "OR".
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How about sharing our format expressions?

Post by rednoah »

Assuming that "3D" is part of the filename, this should do:

Code: Select all

{fn =~ /3D|2160p/ ? 'Movies 4K' : 'Movies'}
:idea: Please read the FAQ and How to Request Help.
yodaspowart
Posts: 16
Joined: 02 Jun 2017, 01:04

Re: How about sharing our format expressions?

Post by yodaspowart »

Thanks.
This is useful to know that the "OR" can be used like that if i needed to trigger variants for the Folder Movies 4K or Movies 3D.

Was thinking the "OR" could be used like:

IF filename has 3D it goes to folder named "Movies 3D" (1920x1080P)
IF filename has 2160p it goes to folder named "Movies 4K" (3840x2160P)
ELSE it goes to folder named "Movies" (< 1920x1080P)

Would it be this work?

Code: Select all

--def "movieFormat={fn =~ /2160p|4K|4k|UHD/ ? 'Movies 4K' : 'Movies'}{fn =~ /3D|3d|3dhsbs|H-SBS|3dhou|H-OU/ ? 'Movies 3D' : 'Movies'}/{n} ({y})/{n} {hd} {vc} {vf} ({y}){' CD'+pi}{'.'+lang}" \
Thanks rednoah
pyropunk2006
Posts: 1
Joined: 14 Dec 2017, 16:48

Re: [SNAP] Grant access to /media

Post by pyropunk2006 »

Any idea how to get filebot to see mounted devices? Its on automount if that makes a difference.
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [SNAP] Grant access to /media

Post by rednoah »

It should work out of the box. What exactly isn't working?
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How about sharing our format expressions?

Post by rednoah »

More like this:

Code: Select all

fn =~ /2160p/ ? 'Movies 4K' : fn =~ /3D/ ? 'Movies 3D' : 'Movies'
You can nest ternary expressions and have lots of if-then-else that way.
:idea: Please read the FAQ and How to Request Help.
yodaspowart
Posts: 16
Joined: 02 Jun 2017, 01:04

Re: How about sharing our format expressions?

Post by yodaspowart »

Thanks rednoah, this perfect for me!

My new script:

Code: Select all

#!/bin/bash

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"

TORRENT_PATH="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
TORRENT_NAME="$TR_TORRENT_NAME"
TORRENT_LABEL="N/A"

# Subtitle language
SUBLANG=en
SKIP_EXTRACT=n
MUSIC=y

filebot -script /opt/filebot/scripts/amc.groovy \
    --output "$HOME/media" \
	-non-strict --encoding utf8 --log all --log-file amc-transmission.log --action copy --conflict override \
	--def artwork=false ut_kind=multi "ut_dir=$TORRENT_PATH" "ut_title=$TORRENT_NAME" subtitles=$SUBLANG \
    --def "movieFormat={fn =~ /2160p|4K|4k|UHD/ ? 'Movies 4K' : fn =~ /3D|3d|3dhsbs|H-SBS|3dhou|H-OU/ ? 'Movies 3D' : 'Movies'}/{n} ({y})/{n} {hd} {vc} {vf} ({y}){' CD'+pi}{'.'+lang}" \
    --def "seriesFormat={fn =~ /2160p|4K|4k|UHD/ ? 'TV Shows 4K' : 'TV Shows'}/{n}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {hd} - {vc} - {vf} - {t.replaceAll(/[\`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part \$1')}{'.'+lang}" \
	extractFolder="$HOME/files/_extracted" music=$MUSIC skipExtract=$SKIP_EXTRACT &
LouisF
Posts: 1
Joined: 29 Nov 2017, 19:46

Re: Exclude Blacklist & Series-Mappings

Post by LouisF »

Hi rednoah, thanks for the awesome work.

A new series by Amazon is not in tvdb, "Jean-Claude Van Johnson" : http://www.imdb.com/title/tt6682754/

Am I at the correct place to request this ? Thanks a lot,
User avatar
rednoah
The Source
Posts: 24645
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Exclude Blacklist & Series-Mappings

Post by rednoah »

You can go to TheTVDB if you want to add or edit series entries:
https://www.thetvdb.com/

This thread is for adding abbreviations that are not in TheTVDB.
:idea: Please read the FAQ and How to Request Help.
jebbe
Posts: 8
Joined: 25 Dec 2017, 04:54

Re: How about sharing our format expressions?

Post by jebbe »

I am absolutely no expert when it comes doing this, but am slowly learning and not trying to over complicate it for myself.

I mainly use FileBot for movies and nothing else. I've essentially used bits from already posted and kind of made it work for my own needs.

Code: Select all

W:\Movies ({vf})\{genre}\{primarytitle} ({y}){' ['+fn.replaceAll(/(?i)directors|theatrical|ultimate/,'$0 Cut').matchAll(/UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTORS.CUT|THEATRICAL.CUT|ULTIMATE.CUT|SPECIAL.EDITION/).join('][').upperInitial().lowerTrail()+']'} [{vf}] [{ac}{fn.match("-HD.MA.")+af}]/{primarytitle} ({y}) {vc}{" (CD$pi)"}{' '+lang}
This is what I currently have and is fine but I have all of my movies stored between two different drives labeled Y and W. I saw the snippet of code to tell Filebot to essentially use whichever drive has more free space to decide where to store said movies.

Code: Select all

{['C:', 'D:', 'E:'].collect{ (it+'/TV/'+n) as File }.sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last()}/{episode}
I've tried to make this work with my current set up but it comes out weird. I've changed the TV part to movies and what I had for movies but it doesn't seem to work right.

Code: Select all

{['Y:', 'W:'].collect{ (it+'/Movies ({vf})/'+n) as File }.sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last()}/{episode}\{genre}\{primarytitle} ({y}){' ['+fn.replaceAll(/(?i)directors|theatrical|ultimate/,'$0 Cut').matchAll(/UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTORS.CUT|THEATRICAL.CUT|ULTIMATE.CUT|SPECIAL.EDITION/).join('][').upperInitial().lowerTrail()+']'} [{vf}] [{ac}{fn.match("-HD.MA.")+af}]/{primarytitle} ({y}) {vc}{" (CD$pi)"}{' '+lang}
I attempted something like this, but it puts the ({vf}) as part of the movies folder title instead of using the command for the video size and it looks like that snippet has stuff for tv shows.

Anyone mind correcting me on this? I'd appreciate any help I can get to make this right. I also am curious about the drive size code, does it only scan the drives on the initial scan of the movie titles and move them into the same folder or does it take into account each movie as it fills up the drive?
jebbe
Posts: 8
Joined: 25 Dec 2017, 04:54

Re: How about sharing our format expressions?

Post by jebbe »

Literally after sharing this, I tinkered with it a bit more and discovered this.

Code: Select all

{['Y:', 'W:'].collect{ (it+'/Movies') as File }.sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last()} ({vf})\{genre}\{primarytitle} ({y}){' ['+fn.replaceAll(/(?i)directors|theatrical|ultimate/,'$0 Cut').matchAll(/UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTORS.CUT|THEATRICAL.CUT|ULTIMATE.CUT|SPECIAL.EDITION/).join('][').upperInitial().lowerTrail()+']'} [{vf}] [{ac}{fn.match("-HD.MA.")+af}]/{primarytitle} ({y}) {vc}{" (CD$pi)"}{' '+lang}
It seems to be working correctly as of right now. Does this look right?
Hercules40
Posts: 33
Joined: 15 Jun 2017, 00:46

Re: How about sharing our format expressions?

Post by Hercules40 »

I need some help. There are many titles that have question marks in them "?". How do I get the "?" removed from the title?

For example, Anime:

Code: Select all

G:\My Videos\Anime\{n.replace(':',' -').replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, " -").replaceTrailingBrackets()}\{'Season '+s}\{n.replace(':',' -').replaceTrailingBrackets()} - {s+'x'}{e.pad(2)} - {t.replace(':',' -').replaceAll(/[!?.*]+$/).replaceAll(/[`´‘’ʻ]/, "'").lowerTrail().replacePart(', Part $1')}
ButI can't get it to work for:

"World End: What do you do at the end of the world? Are you busy? Will you save us?"

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

Re: How about sharing our format expressions?

Post by rednoah »

e.g. replace ? with nothing:

Code: Select all

t.replace('?', '')
:idea: Please read the FAQ and How to Request Help.
Hercules40
Posts: 33
Joined: 15 Jun 2017, 00:46

Re: How about sharing our format expressions?

Post by Hercules40 »

Yeah, I get that. And of course, instead of the title "t", I need to change the name "n". So, I tried this expression, but can anyone tell me why it doesn't work?

Code: Select all

\Anime\{n.replace(':',' -').replace('?','').replaceAll(/[!?.]+$/).replaceAll(/[`´‘’ʻ]/, " -").replaceTrailingBrackets()}\{'Season '+s}\{n.replace(':',' -').replaceTrailingBrackets()} - {s+'x'}{e.pad(2)} - {t.replace(':',' -').replace('?','').replaceAll(/[!?.*]+$/).replaceAll(/[`´‘’ʻ]/, "'").lowerTrail().replacePart(', Part $1')}
Post Reply