Openmediavault Couchpotato Filebot

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
User avatar
DarkVodka34
Posts: 13
Joined: 22 May 2018, 15:56

Openmediavault Couchpotato Filebot

Post by DarkVodka34 »

Howdy I run omv with couchpotato plugin ive been runing filebot on my windows pc to do the renaming as I have a format which I use and works fab

Code: Select all

Z:/Videos/{genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny}
Is there a way I can get this to run auto as soon as the download is done it moves and renames it all for me?
Im planing on getting rid of my laptop as im only keeping it for this very reason of renaming.

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

Re: Openmediavault Couchpotato Filebot

Post by rednoah »

Yes. You can use filebot command-line calls to automate things. I don't use OMV / CP but all of these programs should have some feature that allows you to call scripts or programs on newly downloaded files.

You might find the amc script manual inspiring on how integration works with utorrent, deluge, jdownloader, etc.
:idea: Please read the FAQ and How to Request Help.
User avatar
DarkVodka34
Posts: 13
Joined: 22 May 2018, 15:56

Re: Openmediavault Couchpotato Filebot

Post by DarkVodka34 »

I've looked at the scripts page and was just lost. I don't get it at all. Do you know of any good guides on it?
User avatar
DarkVodka34
Posts: 13
Joined: 22 May 2018, 15:56

Re: Openmediavault Couchpotato Filebot

Post by DarkVodka34 »

Edit. The part I don't get is how to change my code above to the new code on the amc page.
User avatar
rednoah
The Source
Posts: 23469
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Openmediavault Couchpotato Filebot

Post by rednoah »

This is a FileBot format:

Code: Select all

Z:/Videos/{genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny}
This is a command:

Code: Select all

filebot -version
Here's an example for calling the filebot amc script:

Code: Select all

filebot -script fn:amc --output "/path/to/output" --action copy -non-strict "/path/to/input" --log-file amc.log --def excludeList=amc.txt
Here's an example for calling the filebot amc script with your custom format:

Code: Select all

filebot -script fn:amc --output "/path/to/output" --action copy -non-strict "/path/to/input" --log-file amc.log --def excludeList=amc.txt --movieFormat="Z:/Videos/{genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny}"

I'm not sure if this series of examples / explanations make things any more or less clear for you. You will need to have a basic understanding of how to use the command-line and how to use the filebot command on the command-line.


:!: Unfortunately, if you are not familiar with the basics of command-line scripting, then creating a post-processing script for OMV will be impossible for you.


The OMV / CP developers might be very helpful, as they understand how OMV / CP post-processing scripts would be called, and most likely can tell you how to correctly call filebot with that.
:idea: Please read the FAQ and How to Request Help.
User avatar
DarkVodka34
Posts: 13
Joined: 22 May 2018, 15:56

Re: Openmediavault Couchpotato Filebot

Post by DarkVodka34 »

Okay thanks kind of does make sence thank you. OMV is basicly just debian with added extras. Would I install filebot than add the code to CP?
User avatar
rednoah
The Source
Posts: 23469
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Openmediavault Couchpotato Filebot

Post by rednoah »

Yes, this is how it would work. First you need to install FileBot / Java / etc so that the filebot command works, and then you need to configure CP to somehow call filebot on newly added files
:idea: Please read the FAQ and How to Request Help.
User avatar
DarkVodka34
Posts: 13
Joined: 22 May 2018, 15:56

Re: Openmediavault Couchpotato Filebot

Post by DarkVodka34 »

rednoah wrote: 23 May 2018, 04:10 Yes, this is how it would work. First you need to install FileBot / Java / etc so that the filebot command works, and then you need to configure CP to somehow call filebot on newly added files
Thanks ive install Java and Filebot ill see how it goes. CP time.

Edit

Code: Select all

filebot -version
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/filebot/Main : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:64)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:312)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Im guessing Java is not install correct?
User avatar
DarkVodka34
Posts: 13
Joined: 22 May 2018, 15:56

Re: Openmediavault Couchpotato Filebot

Post by DarkVodka34 »

Fixed the issue had wrong version thanks again ill see how it goes with CP! Cheers
User avatar
DarkVodka34
Posts: 13
Joined: 22 May 2018, 15:56

Re: Openmediavault Couchpotato Filebot

Post by DarkVodka34 »

New question there is no options in couchpotato to add a custom renamer. Is there a way I could filebot to say scan this folder every 15 minutes or something

Code: Select all

/media/e3b3d7da-c3b6-4477-9843-fb26d1cb6eb3/Media/Leeching Done/Couch
and run this filebot code you added above

Code: Select all

filebot -script fn:amc --output "/path/to/output" --action copy -non-strict "/path/to/input" --log-file amc.log --def excludeList=amc.txt --movieFormat="/media/e3b3d7da-c3b6-4477-9843-fb26d1cb6eb3/Media/Videos/{genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny}"
Is there a way if so is it easy?

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

Re: Openmediavault Couchpotato Filebot

Post by rednoah »

Can we assume that all the files in this folder are already done and finished? i.e. there are no partially downloaded / currently downloading files?

There are many tools that can help you run FileBot every 15 minutes.

On Linux, the default choice would be cron:
https://opensource.com/article/17/11/how-use-cron-linux


:idea: Make sure to use --action hardlink if you can, i.e. if input / output path are on the same disk / filesystem.
:idea: Please read the FAQ and How to Request Help.
User avatar
DarkVodka34
Posts: 13
Joined: 22 May 2018, 15:56

Re: Openmediavault Couchpotato Filebot

Post by DarkVodka34 »

Yes they are done fully no downloading just downloaded.

Image

I have this on OMV would Ijust add your filebot code

Code: Select all

filebot -script fn:amc --output "/path/to/output" --action copy -non-strict "/path/to/input" --log-file amc.log --def excludeList=amc.txt --movieFormat="/media/e3b3d7da-c3b6-4477-9843-fb26d1cb6eb3/Media/Videos/{genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny}"
Into the command box and set it for 15 minutes is it that easy?
Thanks
User avatar
rednoah
The Source
Posts: 23469
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Openmediavault Couchpotato Filebot

Post by rednoah »

Ideally, yes, it should be that easy. :D
:idea: Please read the FAQ and How to Request Help.
User avatar
DarkVodka34
Posts: 13
Joined: 22 May 2018, 15:56

Re: Openmediavault Couchpotato Filebot

Post by DarkVodka34 »

The code above how would it know which folder to check? also this /path/to/output part do I need to change that? if so is it not the /media/e3b3d7da-c3b6-4477-9843-fb26d1cb6eb3/Media/Videos/ part?

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

Re: Openmediavault Couchpotato Filebot

Post by rednoah »

"/path/to/input" would be the input folder. "/path/to/output" would be the output folder. Your --def movieFormat is relative to --output but you can use an absolute format if you want to override the default --output location for specific files.

Code: Select all

filebot -script fn:amc "/path/to/input" --output "/media/e3b3d7da-c3b6-4477-9843-fb26d1cb6eb3/Media/Videos" ... --def movieFormat="{genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny}" ...

/path/to/input needs to be changed obviously ;)


:idea: If you already know that you're only gonna be processing movies, then adding --def ut_label=Movie would be a good idea.
:idea: Please read the FAQ and How to Request Help.
User avatar
DarkVodka34
Posts: 13
Joined: 22 May 2018, 15:56

Re: Openmediavault Couchpotato Filebot

Post by DarkVodka34 »

Thanks so it would be

Code: Select all

filebot -script fn:amc "/media/e3b3d7da-c3b6-4477-9843-fb26d1cb6eb3/Media/Leeching Done/Sorting/" --output "/media/e3b3d7da-c3b6-4477-9843-fb26d1cb6eb3/Media/Videos" ... --def movieFormat="{genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny}"
So this scans the folder

Code: Select all

/media/e3b3d7da-c3b6-4477-9843-fb26d1cb6eb3/Media/Videos/
And if it finds anything it moves them to

Code: Select all

/media/e3b3d7da-c3b6-4477-9843-fb26d1cb6eb3/Media/Videos
Anime|Animated|Cartoon|Animation|Documentary within Videos

Why is

Code: Select all

--def ut_label=Movie
A good idea and where would it be added

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

Re: Openmediavault Couchpotato Filebot

Post by rednoah »

The amc script (unlike CP) is not designed to process only movie files. Every file you pass in for processing, will be analyzed, to guess if it's a movie or a TV episode or a Anime episode, which is a CPU / memory intensive process that is also error prone.

If you already know that everything is a movie, then the amc script doesn't have to guess (wasting lots of CPU time and possibly guessing wrong) which makes things faster and more predicable all around.

--def ut_label=Movie can be added at the end of your command next to all the other --def name=value options.
:idea: Please read the FAQ and How to Request Help.
User avatar
DarkVodka34
Posts: 13
Joined: 22 May 2018, 15:56

Re: Openmediavault Couchpotato Filebot

Post by DarkVodka34 »

Thanks yes its defo only movies.

Was the code above correct

Code: Select all

filebot -script fn:amc "/media/e3b3d7da-c3b6-4477-9843-fb26d1cb6eb3/Media/Leeching Done/Sorting/" --output "/media/e3b3d7da-c3b6-4477-9843-fb26d1cb6eb3/Media/Videos" ... --def movieFormat="{genres =~ /Anime|Animated|Cartoon|Animation/ ? 'Animated' :genres =~ /Documentary/ ? 'Documentaries' : 'Films'}/{ny}/{ny} --def ut_label=Movie"


Thanks again
Post Reply