Automation

Support for Windows users
Post Reply
david1337
Posts: 13
Joined: 19 Mar 2015, 13:28

Automation

Post by david1337 »

Hey all

Okay first of all, sorry for being absolutely noob in the use of FileBot.
I just found out about this powerful tool today.
After searching the forum for hours I still haven't found a solution to the following scenario:


1. Move all movie folders with their content from the download folder to a specified Movie folder.
2. Only rename folders, not files. So it would look something like this --> \The Dark Knight\The.Dark.Knight.2008.1080p.whatever.mkv
3. Delete all unnecessary files like .nfo, .jpg etc.
4. Download Subtitles for the movie as .srt in a specific language


Any help is very much appreciated!
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automation

Post by rednoah »

1. & 2.
FAQ wrote:Q: How can I rename folders? It's only letting me rename files when I drop folders!
See FAQ.

3.
Are you using the GUI? Not supported.
Are you using the CLI? Check out the cleaner script.

4.
Are you using the GUI? See http://www.filebot.net front page, or FAQ, or video tutorials.
Are you using the CLI? See CLI usage manual and examples.

PS:

The only reason one would rename folders (1) would be to keep all the extra files like .nfo and .jpg files but you say you want to delete all the extra files (3) so what you want (1) doesn't make much sense / is probably bad idea. What you want is moving files (not folders) into a new folder structure while retaining the original name, i.e. use {fn} binding in your format. Please see FAQ #1 for that.
:idea: Please read the FAQ and How to Request Help.
david1337
Posts: 13
Joined: 19 Mar 2015, 13:28

Re: Automation

Post by david1337 »

Hi rednoah

Thank you for taking your time to answer me :)
Sorry for not explaining my setup properly.
Allow me to elaborate.

This is what I do manually atm:

1. Move a folder like "The.Dark.Knight.2008.1080p.whatever" from the Download folder to the Movie folder.

2. Rename it to "The Dark Knight" as I like to have a clean folder structure. (I don't rename the filenames, because I like to keep info like "1080p" "x264" etc in the filename.

3. I delete unwanted files that comes with the download, like *.nfo, samples, jpg files etc. (So now I am left with --> \The Dark Knight\The.Dark.Knight.2008.1080p.whatever.mkv)

4. Then I download the matching subtitles. (Now I have the *.mkv file + the *.srt file)

5. Finally I use Media Companion to scrape all the wanted info about the movie. This gives me the correct *.nfo, cover.jpg, etc. etc. files.



Okay, so I am trying to automate all this into an Autoit script, using Command Lines from different programs (Mainly FileBot, if I can get it working) :)

I started creating the script using theRenamer, but I realized that it has limited options. The only commandline it has is "-fetchmovie" which will move the folder and rename the folder and file. It's unable to rename the folder only.
In my Autoit script, that commandline goes like this:

ShellExecute("C:\Program Files (x86)\theRenamer\theRenamer.exe", "-fetchmovie") <-- I want Filebot to do the work instead of theRenamer.



The scraping part I can make work with Mediacompanion's Commandline, so all good there.

The "cleaning files" part I can script in Autoit as well, but if Filebot already has this feature, I don't have to!



So to summarize:

I need Filebot to do the move/rename/clean/download subs.


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

Re: Automation

Post by rednoah »

It's quite alright, it's pretty much the most basic usage and my post above should address each issue.

1.
Yes? Move rename into new structure. The format for your new structure is defined by you, if you want to keep the whole filename, or parts of it, up to your format. See FAQ #1.

2.
Not an issue if you do (1) since files will be moved as per your format.

3.
Not an issue since the new structure will only contain video files after doing (1) on only video files. Only unwanted files will be left behind, which you can either ignore, or fix by deleting the whole folder.

4.
So what's the issue? How to download subtitles? See www.filebot.net front page and read "Getting Started".

5.
There's plenty of documentation and examples on how to use filebot command-line tools and for your quite simple use-case the amc script will be quite capable of doing it all.
:idea: Please read the FAQ and How to Request Help.
david1337
Posts: 13
Joined: 19 Mar 2015, 13:28

Re: Automation

Post by david1337 »

Hi rednoah

Thanks for your help.

Got most of it working now!
I can rename/move folders the way I want + download subtitles + scrape info.

But how can I delete the unwanted files, before I get the subtitles, and move the folder?

1. First I run this:
ShellExecute("C:\Program Files\FileBot\filebot.exe", "-get-subtitles C:\Blandet\Download\Completed_Movies\*\")
This gives me the English subtitles for every movie in the "Completed_Movies" folder

2. Then I run this:
ShellExecute("C:\Program Files\FileBot\filebot.exe", "-rename C:\Blandet\Download\Completed_Movies\ --output C:\Movies\")
This renames all the movie folders to "Movie (year)" and moves them to "C:\Movies\"

3. So before all this I would like to clean the moviefolders in "Completed_Movies" so they are just like: "\The Dark Knight (2008)\The.Dark.Knight.2008.1080p.whatever.mkv" with no other content.
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automation

Post by rednoah »

1.
Does your script repeatedly try to fetch subtitles for all files, especially considering that badly named video files will remain in your Completed Movies indefinitely? You don't, so you will get yourself banned.

2.
Why does your script not specify a database even though you already know you're processing movies? You will occasionally rename movies as TV series episodes. Plus you will get yourself banned since you repeatedly try to process all files that can't be processed over and over again.

3.
How is this an issue? Your --output folder will not contain any of the extra content.

4.
It looks like you're doing your best to waste resources of various online services begging to get banned.

:arrow: Please read the manual for the amc script • Automated Media Center • which (if used correctly) will do everything you want and help you not get banned.
:idea: Please read the FAQ and How to Request Help.
david1337
Posts: 13
Joined: 19 Mar 2015, 13:28

Re: Automation

Post by david1337 »

As an answer to most of your questions --> I most definitely don't want to get banned or abuse any online services. So it's only a lack of knowledge.

I am now reading all there is about --def commands , so I can set everything up more correctly / non abusive.


2.
--> Could you give an example on how to specify that?


3.
The way I had wrongfully set it up, it moved ALL content. Also the unwanted files.
Now I have tried to add "-script fn:amc --def minFileSize=50000" which kinda makes sure that only the correct movie video file (and for some reason also *.sub files) is transfered.
I could probably define it more correctly. Still testing the --def commands.

4.
Not my intention at all. Working on a better script as we speak.
Btw -> --def excludeList <- this one shouldn't be needed when the destination folder ONLY contains new movies, right? I mean this way no movie would be scanned twice.
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automation

Post by rednoah »

2.
For simple filebot calls you'd add --db TheMovieDB, while forcing movie mode in the amc script would be done via --def ut_label=movie.

3.
As long as you don't force folder mode, and the extra files don't match the video filename, filebot won't and can't process/identify these files. In any case, the amc script has lot more options for input selection.

4.
You're right. But lets assume you have a new file called "abcd123.mp4" which obviously can't be identified or moved by filebot? What will happen? Your setup as to take that into account to avoid processing these kinda files over and over indefinitely.

If you specify --def excludeList you guarantee that each file will only be processed once. Regardless of unexpected cases that you didn't account for. I'd set it. ;)
:idea: Please read the FAQ and How to Request Help.
david1337
Posts: 13
Joined: 19 Mar 2015, 13:28

Re: Automation

Post by david1337 »

Hi rednoah

Thanks for all your help.
Everything is working perfect now :)

One last thing:

How do I make the "--def xbmc=host" command work?

I've tried with:
Part of script: --def seriesFormat={n}/""{'Season'} {+s}""/{fn} --def xbmc=hostname
Part of script: --def seriesFormat={n}/""{'Season'} {+s}""/{fn} --def xbmc=local IP address

Nothing happens - Kodi doesn't rescan library. What am I doing wrong?

Thank you.
User avatar
rednoah
The Source
Posts: 22991
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automation

Post by rednoah »

Both is valid. By IP is usually more reliable. You might have to enable the API / external access first though.
:idea: Please read the FAQ and How to Request Help.
Post Reply