Help! Seperating Movies into different folders HD & 4k

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

Hi
I would like to be able to send movies to different folders depending whether is 4k or hd.

I currently use this....

Code: Select all

filebot -script fn:amc --output "\\192.168.0.111\Multimedia" --action move --conflict auto -non-strict --def clean=y  --def subtitles=en --def movieFormat=@"C:\Filebot Templates\movie.groovy" seriesFormat=@"C:\Filebot Templates\series.groovy" --def unsortedFormat="\\192.168.0.111\Multimedia\Unsorted Files\{file.structurePathTail}" music=n artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"
I would like the 4k target to be \\192.168.0.111\Movies 4K

any help would be appreciated

Movie groovy file

Code: Select all

"Movies/{ny} [{certification}]/{n.colon(' - ')} ({y}) {' CD'+pi} [ {vf} {vc} {bitdepth}bit {ac} {channels} ]"
Series groovy file

Code: Select all

"TV Shows/{n}/{'Season '+s}/{n} - {s00e00} - {t} [ {vf} {vc} {bitdepth}bit {ac} {channels} ]"
Regards :D
User avatar
rednoah
The Source
Posts: 24693
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help! Seperating Movies into different folders HD & 4k

Post by rednoah »

You could use the {hd} binding which will give you SD / HD / UHD for each video file:

Code: Select all

Movies {hd}
Alternatively, you can also do something like this:

Code: Select all

{h > 2000 ? 'Movies 4K' : 'Movies'}
:arrow: i.e. if the video height is more than 2000 pixels, then it's 4K, but you may need to adjust that a bit if you have some kinda super-wide screen media.
:idea: Please read the FAQ and How to Request Help.
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

Hi Rednoah
Thanks for the info. I would like to use the height method as that seems best for me.
Would I need to add the code to the movie.groovy file at the start?
Not sure where it is supposed to go?
Many thanks
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

I have worked it out! Thank you :)
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

I have it working so movies are separated depending if 2160p/uhd into its own folder or anything else into the movie folder. Brilliant!

Code: Select all

\\192.168.0.111/{vf =~ /2160p|uhd|UHD/ ? 'uhd movies' : 'movies'}/{ny} [{certification}]/{n.colon(' - ')} ({y}) [ {vf} {vc} {bitdepth}bit {ac} {channels} ]
I want to move anything uhd/2160p to a different network drive \\192.168.0.111/uhd movies

I have tried adding this into the format

Code: Select all

\\192.168.0.111/{vf =~ /2160p|uhd/ ? '\\192.168.0.111\uhd movies' : 'movies'}/{ny} [{certification}]/{n.colon(' - ')} ({y}) [ {vf} {vc} {bitdepth}bit {ac} {channels} ]
It doesn't work when called from filebot but using filebot gui it worked fine?

Do I have to change the ouput in utorrent?

Code: Select all

filebot -script fn:amc --output "\\192.168.0.111\Multimedia" --action move --conflict auto -non-strict --def clean=y  --def subtitles=en --def movieFormat=@"C:\Filebot Templates\movie.groovy" seriesFormat=@"C:\Filebot Templates\series.groovy" --def unsortedFormat="\\192.168.0.111\Multimedia\Unsorted Files\{file.structurePathTail}" music=n artwork=y "ut_label=%L" "ut_state=%S" "ut_title=%N" "ut_kind=%K" "ut_file=%F" "ut_dir=%D"

I'm now totally stuck, any suggestions?
User avatar
rednoah
The Source
Posts: 24693
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help! Seperating Movies into different folders HD & 4k

Post by rednoah »

1.
e.g. just yield different values for the host / share part:

Code: Select all

//{vf =~ /2160p/ ? 'ServerA/ShareA/UHD Movies' : 'ServerB/ShareB/Movies'}/
e.g. alternatively, this works too:

Code: Select all

{vf =~ /2160p/ ? '//ServerA/ShareA/UHD Movies' : '//ServerB/ShareB/Movies'}/
:idea: {vf} will never have the value UHD.


2.
There's many ways to do it, the goal is to generate a valid UNC path, a NOT this:

Code: Select all

\\192.168.0.111/\\192.168.0.112\uhd movies\...
:idea: Does this kind of path work? IDK. But lets not ever generate file paths like this. :lol:
:idea: Please read the FAQ and How to Request Help.
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

Oh boy I have just realised I'm rubbish at this! HAHAHAHA

Yep I can see how it should work now that makes sense...

Ill give it a try tonight.

Thanks for helping a noob..... again Rednoah :)
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

should I still leave the --output "//192.168.0.111/Multimedia" in the utorrent run program? Or will the movie.groovy file sort that now?
User avatar
rednoah
The Source
Posts: 24693
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help! Seperating Movies into different folders HD & 4k

Post by rednoah »

--output must always point to a valid writable folder for various reasons. Among other things, it's used as base path for relative formats, but if your format is already absolute, then files will be organized exactly as per your absolute format regardless of output folder.
:idea: Please read the FAQ and How to Request Help.
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

ok perfect. thanks
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

Code: Select all

\\192.168.0.111\{vf =~ /2160p/ ? 'UHD Movies' : 'Multimedia/Movies'}/{ny} [{certification}]/{n.colon(' - ')} ({y}) [ {vf} {vc} {bitdepth}bit {ac} {channels} ]
This is what I ended up using and works perfectly. Thank you
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

Another issue I sometime get with

Code: Select all

{ny} [{certification}]/{n.colon(' - ')} ({y}) [ {vf} {vc} {bitdepth}bit {ac} {channels} ]
The certification doesn't always get filled in? Is there a way to remove brackets if it isn't available otherwise I get left with []

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

Re: Help! Seperating Movies into different folders HD & 4k

Post by rednoah »

Yes, this will do:

Code: Select all

{[certification]}
:idea: Please read the FAQ and How to Request Help.
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

Perfect! I think I'm completely sorted now Rednoah.
Amazing software!
User avatar
rednoah
The Source
Posts: 24693
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help! Seperating Movies into different folders HD & 4k

Post by rednoah »

CHA0SENG7NE wrote: 31 Aug 2018, 11:31 Amazing software!
Please spread the word~ :mrgreen:
:idea: Please read the FAQ and How to Request Help.
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

Don't worry I have :)
Redskyer
Posts: 4
Joined: 07 Sep 2018, 06:21

Re: Help! Seperating Movies into different folders HD & 4k

Post by Redskyer »

Hi,

I have a similar problem and don't want to open a new threat for that.

I also want to seperate movies and tv-shows into different folders, but depending on their certification.
It works well as long as the movie or tv-show is certified. When there is no certification, the movie or tv-show won't come into right folder.
I'm using the rednoah/filebot container for docker on a Windows Host.

Code: Select all

filebot -script 'fn:sysinfo'

------------------------------------------

FileBot 4.8.2 (r5789)
JNA Native: 5.2.2
MediaInfo: 18.05
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2018-08-14 (r534)
Groovy: 2.5.1
JRE: Java(TM) SE Runtime Environment 10.0.2
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 4 Core / 1 GB Max Memory / 37 MB Used Memory
OS: Linux (amd64)
HW: Linux fed35c725cdc 4.9.93-linuxkit-aufs #1 SMP Wed Jun 6 16:55:56 UTC 2018 x86_64 GNU/Linux
DATA: /data/.filebot
Package: DOCKER
License: FileBot License XXXXX (Valid-Until: 2068-08-30)
Done ヾ(@⌒ー⌒@)ノ
------------------------------------------

[Process completed]
This is the part of my script (movie):

Code: Select all

{certification == "G" || certification == "PG" ? 'Kinderfilme' : 'Filme'}/{n} ({y})/{n} ({y}) {' CD'+pi}
This is the part of my script (tv-show):

Code: Select all

{certification == "TV-Y" || certification == "TV-Y7" || certification == "TV-G" ? 'Kinderserien' : 'Serien'}/{n} ({y})/{episode.special ? 'Special' : 'Staffel '+s.pad(2)}/{certification} - {n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}
I've created 2 example files to demonstrate what is happening.

Output from GUI:

Code: Select all

filebot -script 'fn:amc' /volume1/JDownloader --output /volume1 --action TEST -non-strict --order Airdate --conflict auto --lang de --def 'music=y' 'unsorted=y' 'artwork=y' 'subtitles=eng' 'clean=y' 'deleteAfterExtract=y' 'minLengthMS=0' 'minFileSize=0' 'seriesFormat={certification == "TV-Y" || certification == "TV-Y7" || certification == "TV-G" ? '\''Kinderserien'\'' : '\''Serien'\''}/{n} ({y})/{episode.special ? '\''Special'\'' : '\''Staffel '\''+s.pad(2)}/{n} - {episode.special ? '\''S00E'\''+special.pad(2) : s00e00} - {t.replaceAll(/[!?.]+$/).replacePart('\'', Part $1'\'')}{'\''.'\''+lang}' 'animeFormat={certification == "TV-Y" || certification == "TV-Y7" || certification == "TV-G" ? '\''Kinderserien'\'' : '\''Serien'\''}/{n} ({y})/{episode.special ? '\''Special'\'' : '\''Staffel '\''+s.pad(2)}/{n} - {episode.special ? '\''S00E'\''+special.pad(2) : s00e00} - {t.replaceAll(/[!?.]+$/).replacePart('\'', Part $1'\'')}{'\''.'\''+lang}' 'movieFormat={certification == "G" || certification == "PG" ? '\''Kinderfilme'\'' : '\''Filme'\''}/{n} ({y})/{n} ({y}) {'\'' CD'\''+pi}' 'musicFormat=Musik/{n}/{album}/{media.TrackPosition.pad(2)} - {t}' 'unsortedFormat=Unbekannt/{fn}.{cf}' 'excludeList=.excludes' --log all --log-file '/usr/local/filebot-node/data/filebot.log'

------------------------------------------

Locking /usr/local/filebot-node/data/filebot.log
Run script [fn:amc] at [Fri Sep 07 06:36:38 UTC 2018]
Parameter: music = y
Parameter: unsorted = y
Parameter: artwork = y
Parameter: subtitles = eng
Parameter: clean = y
Parameter: deleteAfterExtract = y
Parameter: minLengthMS = 0
Parameter: minFileSize = 0
Parameter: seriesFormat = {certification == "TV-Y" || certification == "TV-Y7" || certification == "TV-G" ? 'Kinderserien' : 'Serien'}/{n} ({y})/{episode.special ? 'Special' : 'Staffel '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}
Parameter: animeFormat = {certification == "TV-Y" || certification == "TV-Y7" || certification == "TV-G" ? 'Kinderserien' : 'Serien'}/{n} ({y})/{episode.special ? 'Special' : 'Staffel '+s.pad(2)}/{n} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}
Parameter: movieFormat = {certification == "G" || certification == "PG" ? 'Kinderfilme' : 'Filme'}/{n} ({y})/{n} ({y}) {' CD'+pi}
Parameter: musicFormat = Musik/{n}/{album}/{media.TrackPosition.pad(2)} - {t}
Parameter: unsortedFormat = Unbekannt/{fn}.{cf}
Parameter: excludeList = .excludes
Argument[0]: /volume1/JDownloader
Use excludes: /volume1/.excludes (1)
Input: /volume1/JDownloader/Dragon Ball/dragon.ball.s01e01.h264.br-rip.mkv
Input: /volume1/JDownloader/Dragon Ball/dragon.ball.s01e05.h264.br-rip.mkv
Input: /volume1/JDownloader/Rush Hour/I/rush.hour.h264.br-rip.mkv
rush.hour.h264.br-rip.mkv [series: Rush Hour, movie: Rush Hour (1998)]
Exclude Series: Rush Hour
Group: [tvs:dragon ball] => [dragon.ball.s01e01.h264.br-rip.mkv, dragon.ball.s01e05.h264.br-rip.mkv]
Group: [tvs:null, mov:rush hour 1998] => [rush.hour.h264.br-rip.mkv]
Get [English] subtitles for 2 files
Looking up subtitles by hash via OpenSubtitles
No matching subtitles found: /volume1/JDownloader/Dragon Ball/dragon.ball.s01e01.h264.br-rip.mkv
No matching subtitles found: /volume1/JDownloader/Dragon Ball/dragon.ball.s01e05.h264.br-rip.mkv
Rename episodes using [TheTVDB]
Auto-detected query: [Dragon Ball]
Fetching episode data for [Dragon Ball]
Fetching episode data for [Dragon Ball Z]
Fetching episode data for [Dragon Ball GT]
Fetching episode data for [Dragon Ball Kai]
Fetching episode data for [Dragon Ball Super]
[TEST] from [/volume1/JDownloader/Dragon Ball/dragon.ball.s01e01.h264.br-rip.mkv] to [/Dragon Ball (1986)/Staffel 01/Dragon Ball - S01E01 - Das Geheimnis des Dragonballs.mkv]
[TEST] from [/volume1/JDownloader/Dragon Ball/dragon.ball.s01e05.h264.br-rip.mkv] to [/Dragon Ball (1986)/Staffel 01/Dragon Ball - S01E05 - Yamchu der Wüstenräuber.mkv]
Processed 2 files
Get [English] subtitles for 1 files
Looking up subtitles by hash via OpenSubtitles
No matching subtitles found: /volume1/JDownloader/Rush Hour/I/rush.hour.h264.br-rip.mkv
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/volume1/JDownloader/Rush Hour/I/rush.hour.h264.br-rip.mkv]
[TEST] from [/volume1/JDownloader/Rush Hour/I/rush.hour.h264.br-rip.mkv] to [/volume1/Filme/Rush Hour (1998)/Rush Hour (1998).mkv]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ
------------------------------------------

[Process completed]
Output from CLI (PowerShell):

Code: Select all

docker run --rm --volumes-from Filebot_GUI --mount type=bind,source="Z:\Downloads",target=/volume1 --name Filebot rednoah/filebot -script 'fn:amc' /volume1/JDownloader/ --output /volume1/ --action TEST -non-strict --order Airdate --conflict auto --lang de --def 'music=y' 'unsorted=y' 'artwork=y' 'subtitles=eng' 'clean=y' 'deleteAfterExtract=y' 'minLengthMS=0' 'minFileSize=0' 'seriesFormat={certification == "\""TV-Y"\"" || certification == "\""TV-Y7"\"" || certification == "\""TV-G"\"" ? "\""Kinderserien"\"" : "\""Serien"\""}/{n} ({y})/{episode.special ? "\""Special"\"" :"\""Staffel "\""+s.pad(2)}/{n} - {episode.special ? "\""S00E"\""+special.pad(2) : s00e00} - {t.replaceAll(/[!?.]+$/).replacePart("\"", Part ${1}"\"")}{"\""."\""+lang}' 'animeFormat={certification == "\""TV-Y"\"" || certification == "\""TV-Y7"\"" || certification == "\""TV-G"\"" ? "\""Kinderserien"\"" : "\""Serien"\""}/{n} ({y})/{episode.special ? "\""Special"\"" : "\""Staffel "\""+s.pad(2)}/{n} - {episode.special ? "\""S00E"\""+special.pad(2) : s00e00} - {t.replaceAll(/[!?.]+$/).replacePart("\"", Part ${1}"\"")}{"\""."\""+lang}' 'movieFormat={certification == "\""G"\"" || certification == "\""PG"\"" ? "\""Kinderfilme"\"" : "\""Filme"\""}/{n} ({y})/{n} ({y}) {"\"" CD"\""+pi}' 'musicFormat=Musik/{n}/{album}/{media.TrackPosition.pad(2)} - {t}' 'unsortedFormat=Unbekannt/{fn}.{cf}' 'excludeList=.excludes' --log all --log-file '/usr/local/filebot-node/data/filebot.log'
Locking /usr/local/filebot-node/data/filebot.log
Run script [fn:amc] at [Fri Sep 07 07:00:20 UTC 2018]
Parameter: music = y
Parameter: unsorted = y
Parameter: artwork = y
Parameter: subtitles = eng
Parameter: clean = y
Parameter: deleteAfterExtract = y
Parameter: minLengthMS = 0
Parameter: minFileSize = 0
Parameter: seriesFormat = {certification == "TV-Y" || certification == "TV-Y7" || certification == "TV-G" ? "Kinderserien" : "Serien"}/{n} ({y})/{episode.special ? "Special" : "Staffel "+s.pad(2)}/{n} - {episode.special ? "S00E"+special.pad(2) : s00e00} - {t.replaceAll(/[!?.]+$/).replacePart(", Part ${1}")}{"."+lang}
Parameter: animeFormat = {certification == "TV-Y" || certification == "TV-Y7" || certification == "TV-G" ? "Kinderserien" : "Serien"}/{n} ({y})/{episode.special ? "Special" : "Staffel "+s.pad(2)}/{n} - {episode.special ? "S00E"+special.pad(2) : s00e00} - {t.replaceAll(/[!?.]+$/).replacePart(", Part ${1}")}{"."+lang}
Parameter: movieFormat = {certification == "G" || certification == "PG" ? "Kinderfilme" : "Filme"}/{n} ({y})/{n} ({y}) {" CD"+pi}
Parameter: musicFormat = Musik/{n}/{album}/{media.TrackPosition.pad(2)} - {t}
Parameter: unsortedFormat = Unbekannt/{fn}.{cf}
Parameter: excludeList = .excludes
Argument[0]: /volume1/JDownloader
Use excludes: /volume1/.excludes (1)
Input: /volume1/JDownloader/Dragon Ball/dragon.ball.s01e01.h264.br-rip.mkv
Input: /volume1/JDownloader/Dragon Ball/dragon.ball.s01e05.h264.br-rip.mkv
Input: /volume1/JDownloader/Rush Hour/I/rush.hour.h264.br-rip.mkv
rush.hour.h264.br-rip.mkv [series: Rush Hour, movie: Rush Hour (1998)]
Exclude Series: Rush Hour
Group: [tvs:dragon ball] => [dragon.ball.s01e01.h264.br-rip.mkv, dragon.ball.s01e05.h264.br-rip.mkv]
Group: [tvs:null, mov:rush hour 1998] => [rush.hour.h264.br-rip.mkv]
Get [English] subtitles for 2 files
Looking up subtitles by hash via OpenSubtitles
No matching subtitles found: /volume1/JDownloader/Dragon Ball/dragon.ball.s01e01.h264.br-rip.mkv
No matching subtitles found: /volume1/JDownloader/Dragon Ball/dragon.ball.s01e05.h264.br-rip.mkv
Rename episodes using [TheTVDB]
Auto-detected query: [Dragon Ball]
Fetching episode data for [Dragon Ball]
Fetching episode data for [Dragon Ball Z]
Fetching episode data for [Dragon Ball GT]
Fetching episode data for [Dragon Ball Kai]
Fetching episode data for [Dragon Ball Super]
[TEST] from [/volume1/JDownloader/Dragon Ball/dragon.ball.s01e01.h264.br-rip.mkv] to [/Dragon Ball (1986)/Staffel 01/Dragon Ball - S01E01 - Das Geheimnis des Dragonballs.mkv]
[TEST] from [/volume1/JDownloader/Dragon Ball/dragon.ball.s01e05.h264.br-rip.mkv] to [/Dragon Ball (1986)/Staffel 01/Dragon Ball - S01E05 - Yamchu der Wüstenräuber.mkv]
Processed 2 files
Get [English] subtitles for 1 files
Looking up subtitles by hash via OpenSubtitles
No matching subtitles found: /volume1/JDownloader/Rush Hour/I/rush.hour.h264.br-rip.mkv
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/volume1/JDownloader/Rush Hour/I/rush.hour.h264.br-rip.mkv]
[TEST] from [/volume1/JDownloader/Rush Hour/I/rush.hour.h264.br-rip.mkv] to [/volume1/Filme/Rush Hour (1998)/Rush Hour (1998).mkv]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ
As you can see, Dragon Ball is not moved into the "volume1/Serien/..." folder as expected, but to "/Dragon Ball/...", what makes no sense. Any idea what's going wrong?
User avatar
rednoah
The Source
Posts: 24693
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help! Seperating Movies into different folders HD & 4k

Post by rednoah »

I'm not sure what the problem is. Do you have a simple test case that illustrates the problem?

A quick glance shows that you might not take the exceptional / undefined case into account:
viewtopic.php?f=5&t=1895


e.g. if certification is undefined, the expression will fail, and the result will be nothing, and not "Filme" as you might expect from this code:

Code: Select all

{certification == "G" || certification == "PG" ? 'Kinderfilme' : 'Filme'}
e.g. take certification undefined into account like this:

Code: Select all

{any{if (certification == "G" || certification == "PG") 'Kinderfilme'}{'Filme'}}
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Help! Seperating Movies into different folders HD & 4k

Post by kim »

Or, even better make an account and update the info... Rating/Certification here:

https://www.thetvdb.com/series/dragon-ball
https://www.themoviedb.org/tv/12609-dra ... uage=en-US
Redskyer
Posts: 4
Joined: 07 Sep 2018, 06:21

Re: Help! Seperating Movies into different folders HD & 4k

Post by Redskyer »

rednoah wrote: 07 Sep 2018, 18:30 I'm not sure what the problem is. Do you have a simple test case that illustrates the problem?

A quick glance shows that you might not take the exceptional / undefined case into account:
viewtopic.php?f=5&t=1895


e.g. if certification is undefined, the expression will fail, and the result will be nothing, and not "Filme" as you might expect from this code:

Code: Select all

{certification == "G" || certification == "PG" ? 'Kinderfilme' : 'Filme'}
e.g. take certification undefined into account like this:

Code: Select all

{any{if (certification == "G" || certification == "PG") 'Kinderfilme'}{'Filme'}}
That is the solution for my problem! :D
Thank you very much!

@kim: That's also a good idea. Everytime I see a problem like this, I'll update the database.
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

Code: Select all

\\192.168.0.111\{vf =~ /2160p/ ? 'UHD Movies' : 'Multimedia/Movies'}/{ny} [{certification}]/{n.colon(' - ')} ({y}) [ {vf} {vc} {bitdepth}bit {ac} {channels} ]
With moving fIles to different folders using resolution is it also possible to add another folder for just 3d movies?

E.g depending on whether its 2160p,3d or standard movie?
User avatar
rednoah
The Source
Posts: 24693
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help! Seperating Movies into different folders HD & 4k

Post by rednoah »

Yes, works exactly the same:

Code: Select all

{f =~ /3D/ ? '3D Movies' : vf =~ /2160p/ ? 'UHD Movies' : 'Multimedia/Movies'}
:!: How you identify 3D Movies is more tricky though. In this example we assume that 3D movies have "3D" in the file path.
:idea: Please read the FAQ and How to Request Help.
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

Thank you. That does make sense but as you are relying on the file containing 3d. Can you add extra options? Say 3-d or 3.d ? Just to give more chance?

Is this correct ?

Code: Select all

{f =~ /3D|3.d|3-d/ ? '3D Movies' : vf =~ /2160p/ ? 'UHD Movies' : 'Multimedia/Movies'}
Thanks again Rednoah
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Help! Seperating Movies into different folders HD & 4k

Post by kim »

Regular Expression: https://regexr.com/

Code: Select all

{f =~ /(?i)3D|3\.D|3\-D/ ? '3D Movies' : '3D...NOT!'}
User avatar
rednoah
The Source
Posts: 24693
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help! Seperating Movies into different folders HD & 4k

Post by rednoah »

On a related note, does anybody have a large collection of 3D movies? Does anybody know any heuristics based on the mediainfo data we can use to detect 3D movies? Like maybe very odd aspect ratio? Or some other 3D encoding field?



EDIT:

:arrow: :arrow: [SNIPPET] Separate 4K Movies and non-4K Movies
:idea: Please read the FAQ and How to Request Help.
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

Thanks rednoah,
That has worked perfectly.
I just tried with a batch of different files. All going to the correct location.
CHA0SENG7NE
Posts: 70
Joined: 19 Apr 2017, 22:13

Re: Help! Seperating Movies into different folders HD & 4k

Post by CHA0SENG7NE »

Hi Rednoah, just want to say thanks. The 3D movies I have are now sorted into the correct folder. Works perfectly :)
howdymilsap
Posts: 35
Joined: 14 Jul 2018, 17:22

Re: Help! Seperating Movies into different folders HD & 4k

Post by howdymilsap »

rednoah wrote: 07 Oct 2018, 06:00 On a related note, does anybody have a large collection of 3D movies? Does anybody know any heuristics based on the mediainfo data we can use to detect 3D movies? Like maybe very odd aspect ratio? Or some other 3D encoding field?
I have been working on my format expression to properly organize my collection - which includes some 3D titles. To be honest, I am struggling with this a bit, but that is a topic for another thread.

I can provide to you whatever output you need from mediainfo that might help in better 3D content identification. Just let me know what you need and I will provide it.

btw, I also have downloaded many test 3D files from https://www.demo-world.eu/3d-demo-trailers-hd/, and these files might provide you the information you need without having to have access to a large 3D movie collection.
User avatar
rednoah
The Source
Posts: 24693
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help! Seperating Movies into different folders HD & 4k

Post by rednoah »

You can copy & paste the MediaInfo table, so we can see if there's any characteristics that are common to all 3D movies:
viewtopic.php?f=5&t=4285
:idea: Please read the FAQ and How to Request Help.
yodaspowart
Posts: 16
Joined: 02 Jun 2017, 01:04

Re: Help! Seperating Movies into different folders HD & 4k

Post by yodaspowart »

This is what Im using for 3D Movies:

3D|3d|HSBS|3dhsbs|H-SBS|3dhou|H-OU

Code: Select all

--def "movieFormat={fn =~ /2160p|4K|4k|UHD/ ? 'Movies 4K' : fn =~ /3D|3d|HSBS|3dhsbs|H-SBS|3dhou|H-OU/ ? 'Movies 3D' : 'Movies'}/{n} ({y}) - {allOf{match}{s3d}{hd}{vc}{vf}{n.findMatch(group) ? null : '- '+group} join ' '} {' CD'+pi}{'.'+lang}" \
TomTomTuning
Posts: 12
Joined: 23 Nov 2016, 14:46

Re: Help! Seperating Movies into different folders HD & 4k

Post by TomTomTuning »

Is there any way I an direct 4K content to a specific folder while using FileBot Node?
User avatar
rednoah
The Source
Posts: 24693
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help! Seperating Movies into different folders HD & 4k

Post by rednoah »

Yes. You'll need to pass in your own custom format though, that yields different destination paths for different files, as explained in this thread.

:arrow: Best to use the GUI first to prototype your format, and then just copy & paste it into FileBot Node when you're happy with it.
:idea: Please read the FAQ and How to Request Help.
devster
Posts: 417
Joined: 06 Jun 2017, 22:56

Re: Help! Seperating Movies into different folders HD & 4k

Post by devster »

rednoah wrote: 07 Oct 2018, 06:00 On a related note, does anybody have a large collection of 3D movies? Does anybody know any heuristics based on the mediainfo data we can use to detect 3D movies? Like maybe very odd aspect ratio? Or some other 3D encoding field?
For MediaInfo in BluRays there might be MultiView_Count MultiView_Layout and the "Stereo" keyword in Format_Profile in Video

Code: Select all

Format profile                   : Stereo [email protected]
MultiView_Count                  : 2
MultiView_Layout                 : Side by Side (left eye first)
and for MKV only there can be STEREO_MODE defined in the General part.
All these, however, seem to depend on the encoder and not on characteristics of the video file, meaning that if whoever creates the file does not properly tag it there doesn't seem to be a way to detect it, at least with MediaInfo.
Not sure about ffmpeg.
I only work in black and sometimes very, very dark grey. (Batman)
eggsplorer
Posts: 12
Joined: 21 Jun 2019, 23:05

Re: Help! Seperating Movies into different folders HD & 4k

Post by eggsplorer »

I'd like to move 4K movies into a seperate subfolder and tried to use the suggested expressions:

Code: Select all

#!/bin/sh
## Variablen
LOG="/srv/dev-disk-by-label-Medien/Downloads/filebot/amc.log"
EXC="/srv/dev-disk-by-label-Medien/Downloads/filebot/amc.txt"
SERIEN="/srv/dev-disk-by-label-Medien/Medien/Serien/{n}/Staffel {s}/{n} - {s00e00} - {t}"
FILME="/srv/dev-disk-by-label-Medien/Medien/{vf =~ /2160p/ ? 'Filme/2. 4K' : 'Filme'}/{n} ({y})/{n} ({y}) [{rating}]"
## FileBot ausführen
/usr/share/filebot/bin/filebot.sh -script fn:amc --lang de --log-file $LOG --action move "$1" --def "seriesFormat=$SERIEN" "movieFormat=$FILME" -non-strict --def clean=y
/usr/share/filebot/bin/filebot.sh -script fn:cleaner "$1"
This script worked when I used "Filme" insted of the Format Expression "{vf =~ /2160p/ ? 'Filme\2. 4K' : 'Filme'}"
Now my movies are getting moved to "/srv/dev-disk-by-label-Medien/Medien/{n} ({y})/{n} ({y}) [{rating}]" (neither /Filme nor /Filme/2. 4K) and I don't understand why.

I just want "normal" movies to move to "/Medien/Filme"
and 4K Movies to "/Medien/Filme/2. 4K"
User avatar
rednoah
The Source
Posts: 24693
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help! Seperating Movies into different folders HD & 4k

Post by rednoah »

What does filebot -script fn:sysinfo say?


:idea: If {vf =~ /2160p/ ? 'A' : 'B'} fails, you get neither A or B, and since that is what you describe, the most likely culprit is {vf} not yielding any value.


:idea: Please read How to Request Help.
:idea: Please read the FAQ and How to Request Help.
eggsplorer
Posts: 12
Joined: 21 Jun 2019, 23:05

Re: Help! Seperating Movies into different folders HD & 4k

Post by eggsplorer »

I tried to use only {vf} but it still doesn't do anything.

This is my console log: https://pastebin.com/MAfwUqrr

My AMC script:

Code: Select all

#!/bin/sh
## Variablen
LOG="/srv/dev-disk-by-label-Medien/Downloads/filebot/amc.log"
EXC="/srv/dev-disk-by-label-Medien/Downloads/filebot/amc.txt"
SERIEN="/srv/dev-disk-by-label-Medien/Medien/Serien/{n}/Staffel {s}/{n} - {s00e00} - {t}"
FILME="/srv/dev-disk-by-label-Medien/Medien/{vf}/{n} ({y})/{n} ({y}) [{rating}]"
## FileBot ausführen
/usr/share/filebot/bin/filebot.sh -script fn:amc --lang de --log-file $LOG --action move "$1" --def "seriesFormat=$SERIEN" "movieFormat=$FILME" -non-strict --def clean=y --def 'kodi=192.168.2.141:8080'
/usr/share/filebot/bin/filebot.sh -script fn:cleaner "$1"
/usr/share/filebot/bin/filebot.sh -script fn:sysinfo
I noticed the error regarding mediainfo. Could this be the root of the problem?
User avatar
rednoah
The Source
Posts: 24693
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help! Seperating Movies into different folders HD & 4k

Post by rednoah »

1.
Yes, correct. Since MediaInfo is not working, MediaInfo-based bindings won't work:

Code: Select all

MediaInfo: net.filebot.mediainfo.MediaInfoException: Unable to load amd64 (64-bit) native library libmediainfo.so: Unable to load library 'zen': Native library (linux-x86-64/libzen.so) not found in resource path ([file:/usr/share/filebot/jar/filebot.jar])
:idea: viewtopic.php?t=4285


2.
:?: How did you install FileBot? Which package exactly? Are all dependencies installed?

:arrow: I recommend using the deb.sh auto-installer script: viewtopic.php?f=11&t=6028

:!: Running is root is also strongly discouraged.
:idea: Please read the FAQ and How to Request Help.
eggsplorer
Posts: 12
Joined: 21 Jun 2019, 23:05

Re: Help! Seperating Movies into different folders HD & 4k

Post by eggsplorer »

Unfortunately I don't recall how I installed filebot but I just installed it again using your reccommendet method:

Code: Select all

bash -xu <<< "$(curl -fsSL https://raw.githubusercontent.com/filebot/plugins/master/installer/deb.sh)"
I still get errors for MediaInfo and 7zip: https://pastebin.com/SaDKcfLC

Is there a way to install them manually?

Edit:
Now I'm not sure whether or not I uninstalled and installed filebot correctly.
I used "apt-get remove --purge filebot" and then used the command mentioned above (deb.sh).
Shouldn't my license be purged aswell?
User avatar
rednoah
The Source
Posts: 24693
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help! Seperating Movies into different folders HD & 4k

Post by rednoah »

Is libzen installed?
https://packages.debian.org/buster/libzen0v5

Are dependencies being installed when apt install filebot is called?

:!: It is possible to configure apt to not install recommended dependencies.

You can check:

Code: Select all

apt-cache depends filebot
:idea: https://unix.stackexchange.com/a/32860/78608
:idea: Please read the FAQ and How to Request Help.
eggsplorer
Posts: 12
Joined: 21 Jun 2019, 23:05

Re: Help! Seperating Movies into different folders HD & 4k

Post by eggsplorer »

It worked!

Those are the dependencies:

Code: Select all

apt-cache depends filebot
filebot
  Hängt ab von: openjdk-8-jre
  Hängt ab von: libjna-java
  Empfiehlt: openjfx
  Empfiehlt: mediainfo
  Empfiehlt: libchromaprint-tools
  Empfiehlt: p7zip-full
  Empfiehlt: <unrar>
  Wertet auf: nautilus-actions
So I just installed the missing dependencies manually:

Code: Select all

sudo apt-get install libzen0v5
sudo apt-get install mediainfo
sudo apt-get install p7zip-full
sudo apt-get install unrar (didn't work!!!)
sudo apt-get install unrar-free
This is my result: https://pastebin.com/pe3Jwm8c

I still get an error for unrar, maybe because I couldn't install "unrar" and had to install "unrar-free".

Code: Select all

unrar: Archive not specified
 unrar: net.filebot.ExecuteException: [unrar] failed (1)
For now I don't need to use unrar but I will propably try it since it seems to be the recommended method to combine jDownloader and FileBot.
User avatar
rednoah
The Source
Posts: 24693
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help! Seperating Movies into different folders HD & 4k

Post by rednoah »

JD would typically unrar files before passing them on to FileBot (via the glue logic scripts found here in the forums) but if JD requires the unrar tool for that I cannot say, though probably does.
:idea: Please read the FAQ and How to Request Help.
eggsplorer
Posts: 12
Joined: 21 Jun 2019, 23:05

Re: Help! Seperating Movies into different folders HD & 4k

Post by eggsplorer »

JD usually does unrar the files and calls FileBot with the EventScripter after the package is extracted which works fine.
There is one "known issue" though (also mentioned in your Tutorial) which does indeed cause trouble:
If JDownloader finishes extracting a package ( -> calling FileBot) but is still extracting a second package, FileBot will start processing the partially extracted files.
This is obviously a JDownloader issue or rather results from combining those two tools, but it is really inconvinient.

You posted a solution but to be honest I don't really understand what it does and how it is solving this problem.
Post Reply