POSTBUCKET - where random posts in unrelated topics go

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

Re: How about sharing our format expressions?

Post by rednoah »

{s00e00.lower()} ;)
:idea: Please read the FAQ and How to Request Help.
ehmtwo
Posts: 5
Joined: 05 Nov 2012, 05:59

Re: How about sharing our format expressions?

Post by ehmtwo »

<3
cgibby
Posts: 2
Joined: 09 Nov 2012, 06:02

Re: Fully Automated Media Center

Post by cgibby »

Is there a way to override the "format" expressions in the "utorrent-postprocess" function to specify my own preferences for the filepaths? I mean that I'd rather not put my TV shows and movies into separate subdirectories, and I like the {n}.{s00e00}.{t} episode filename format better than the default with the spaces and the hyphens.

I tried creating my own version of utorrent-postprocess.groovy, with the following changes, and referencing it locally, but my files just got un-rar-ed, no renaming or moving happened.

Code: Select all

def format = [
	tvs:   '''{n}{episode.special ? " - Special" : " - Season "+s.pad(2)}/{n}.{episode.special ? "S00E"+special.pad(2) : s00e00}.{t}''',
	anime: '''Anime/{n}/{n} - {sxe} - {t}''',
	mov:   '''{n} ({y})/{n} [{y}]{" CD$pi"}{".$lang"}'''
]
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated Media Center

Post by rednoah »

What's the error output? Did you forget to copy lib/*.groovy? It'll need that for artwork/email/etc
:idea: Please read the FAQ and How to Request Help.
cgibby
Posts: 2
Joined: 09 Nov 2012, 06:02

Re: Fully Automated Media Center

Post by cgibby »

Ah, yes, that did it. Once I downloaded the /lib/*.groovy files, my homebrew version of utorrent-postprocess.groovy worked great. Thanks for the info and for this great program. FileBot with these customizations should save me tons of time versus my old workflow!
ohadbenita
Posts: 9
Joined: 26 Nov 2012, 07:38

Re: How about sharing your CLI scripts?

Post by ohadbenita »

filebot -script fn:revert path/to/files --action rename doesn't work:

C:\Users\HTPC>filebot -script fn:revert "a:/tv shows/homeland/" --action rename
IllegalArgumentException: Illegal rename action: rename
java.lang.IllegalArgumentException: Illegal rename action: rename
at net.sourceforge.filebot.StandardRenameAction.forName(Unknown Source)
at net.sourceforge.filebot.StandardRenameAction$forName.call(Unknown Sou
rce)
at Script3.revert(Script3.groovy:9)
at Script3$_run_closure1.doCall(Script3.groovy:18)
at Script3.run(Script3.groovy:16)
at net.sourceforge.filebot.cli.ScriptShell.evaluate(Unknown Source)
at net.sourceforge.filebot.cli.ScriptShell.runScript(Unknown Source)
at net.sourceforge.filebot.cli.ArgumentProcessor.process(Unknown Source)

at net.sourceforge.filebot.Main.main(Unknown Source)
Failure (░_░)
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How about sharing your CLI scripts?

Post by rednoah »

Sorry, you'll need to grab the latest build or wait for the next release if you really need --action rename.
:idea: Please read the FAQ and How to Request Help.
opentag
Posts: 1
Joined: 30 Nov 2012, 17:17

Re: Fully Automated Media Center

Post by opentag »

Great script!

2 quick questions -

Is there a way to include the style of file name format desired in the command line? I've modified the GUI usage to output the files in the format I want but the command line output doesn't seem to match the format I was hoping for.

While artwork=yes seems to get all the nfo and other pieces for the Show in question it doesn't appear to get an nfo for the specific Episode being worked on. Am I missing something there?

Thanks again for the great script!
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated Media Center

Post by rednoah »

1. Cmdline is configured via cmdline options only, it does not magically use random GUI settings (albeit easy to add, that'd be very unclean).

2. Added support for overriding the default naming formats via --def:
--def "seriesFormat=TV/…"
--def "animeFormat=Anime/…"
--def "movieFormat=Movies/…"

Not gonna advertise that much since people are just gonna mess up the cmdline arguments with unescaped quotes. If you don't understand how arguments are parsed in your shell you will probably run into problems if you use single/double quotes, ampersands, etc in your format.

3. Episode Nfos are pretty much useless and with well-named files any HTPC software can grab that info easily anyway.
:idea: Please read the FAQ and How to Request Help.
verysofttoiletpaper
Posts: 141
Joined: 05 Jul 2012, 09:44

Re: Fully Automated Media Center

Post by verysofttoiletpaper »

Hi!

I was just expanding the functionality of the deluge adaptor, and just realised symlinks don't work.
Why does filebot need to run as with root privileges in order to create symlinks?

Cheers!
verysofttoiletpaper
Posts: 141
Joined: 05 Jul 2012, 09:44

Re: Fully Automated Media Center

Post by verysofttoiletpaper »

Actually, I was wrong.
It is failing even running it with sudo.
I get "Exception: Unsupported Operation: createSymbolicLink"

Any idea why?
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated Media Center

Post by rednoah »

On Windows it needs to be admin. Linux should work fine as normal users. You'll need Java 7 though.
:idea: Please read the FAQ and How to Request Help.
verysofttoiletpaper
Posts: 141
Joined: 05 Jul 2012, 09:44

Re: Fully Automated Media Center

Post by verysofttoiletpaper »

Yes, installing Java 7 from oracle fixed the problem thanks :)
verysofttoiletpaper
Posts: 141
Joined: 05 Jul 2012, 09:44

Re: Fully Automated Media Center

Post by verysofttoiletpaper »

Would be useful to have a script option to disable archive extraction..
Cheers and good work!
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated Media Center

Post by rednoah »

Why would that be useful? Right now it'll only extract archives that contain video files.
:idea: Please read the FAQ and How to Request Help.
verysofttoiletpaper
Posts: 141
Joined: 05 Jul 2012, 09:44

Re: Fully Automated Media Center

Post by verysofttoiletpaper »

Oh.. in that case..
I thought it was extracting all files first

Thanks
verysofttoiletpaper
Posts: 141
Joined: 05 Jul 2012, 09:44

Re: Fully Automated Media Center

Post by verysofttoiletpaper »

By the way, Plex integration doesn't seem to be working, maybe due to a new version...

http://$server:$port/plex doesn't seem to contain any useful information anymore: http://hastebin.com/cafivirihi.xml
On the other hand, http://miner:32400/library/sections/ seems to have all the needed information: http://hastebin.com/pifugopihe.xml

Can you make it work again? :D
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated Media Center

Post by rednoah »

Does the rescan request still work like this?
http://$server:$port/library/sections/$key/refresh/
:idea: Please read the FAQ and How to Request Help.
cheesemaker
Posts: 49
Joined: 03 Sep 2012, 10:52

Re: Fully Automated Media Center

Post by cheesemaker »

Yes, http://$server:$port/library/sections/all/refresh, worked for me.
http://wiki.plexapp.com/index.php/PlexN ... g_Sections
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated Media Center

Post by rednoah »

Updated it the way you suggested. Should take effect by tomorrow.
:idea: Please read the FAQ and How to Request Help.
beeman147
Posts: 1
Joined: 22 Dec 2012, 05:57

Re: Fetch Artwork and Nfo for Movies

Post by beeman147 »

rednoah wrote:Description:
  1. Download artwork for all your Movies from TheMovieDB. Fetch Movie nfo and all kinds of artwork and save files according to XBMC standards.
  2. Disable GUI tv series confirmation dialogs via -non-strict option (on headless machines this is the default).
Usage:

Code: Select all

filebot -script fn:artwork.tmdb /path/to/movies/
Options:
--conflict override to fetch artwork from scratch (not just missing artwork)
-non-strict to disable user-interaction and run headless

Notes:
* Movies are expected to be organized into folders. The movie is determined using the name of the parent folder of each video file.

Download Script:
http://filebot.sf.net/scripts/artwork.tmdb.groovy
Hello, thanks for the great program. It's really helped me begin the quest to get organized!

I have got this script working from the command line but it returns 'Movie Not Found' for each movie in the folder.
I have all movies in their own folder as suggested, but the folder names have the format:

{n} [{y},{director}][{source}]

As a test, I changed the folder for the first film to {n} [{y}] and this worked.
How could I modify the script to be able to pick up the movie name correctly?
Or would it be better to just use the {n} [{y}] naming convention?

Much appreciated
Bee
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How about sharing your CLI scripts?

Post by rednoah »

:idea: Please read the FAQ and How to Request Help.
danielsokolowski
Posts: 9
Joined: 03 Jan 2013, 01:55

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Post by danielsokolowski »

Sublight now allows free API keys again: http://www.sublight.si/RegisterClient.aspx. This is the wrong thread for this but why aren't there any GUI options for all these 'filebot -script fn:<commands>' ? As a new user I find it intimidating.
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Post by rednoah »

Well, one thing is that many people use FileBot without any GUI so this works for everybody.

More importantly if your run -script fn:configure it'll download the script and since API client/keys are hard-coded (currently FileBot identifies itself as SublightCmd) in the script I can easily auto-update these settings without a new release.
:idea: Please read the FAQ and How to Request Help.
beeblebrox42
Posts: 3
Joined: 05 Jan 2013, 19:52

Re: Fully Automated Media Center

Post by beeblebrox42 »

I'm not integrating with utorrent, but this script via cli mode almost does everything I need it to, so thanks!

However I can't figure out how to get the hardlink action to work which I really need. The output claims it is a hardlink rename but it only creates the directories and not the file link. The docs say utorrent must be ran as 'admin', so I am guessing I must run filebot as root? In my script I sudo run filebot but that didn't resolve the issue. I'm a bit stuck and looking for help.

I'm running on a 64bit linux distribution.

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

Re: Fully Automated Media Center

Post by rednoah »

What's the cmdline output? If you're using --action hardlink it'll do that or print errors if it doesn't work. Make sure you're using Java 7, on linux you don't need to be root to create hardlinks.
:idea: Please read the FAQ and How to Request Help.
beeblebrox42
Posts: 3
Joined: 05 Jan 2013, 19:52

Re: Fully Automated Media Center

Post by beeblebrox42 »

rednoah wrote:What's the cmdline output? If you're using --action hardlink it'll do that or print errors if it doesn't work. Make sure you're using Java 7, on linux you don't need to be root to create hardlinks.
Thanks for the rapid response. I knew hardlinks in linux normally didn't require root, thought it was a java limitation.

If hardlinking requires Java 7 that might be the issue. I am using OpenJDK 1.6.0_24. I'll try to see if can upgrade to 1.7 and report back.

Code: Select all

FileBot 3.2 (r1372)
JNA Native: 3.5.0
MediaInfo: MediaInfoLib - v0.7.61
7-Zip-JBinding: OK
Extended Attributes: java.lang.NoClassDefFoundError: Ljava/nio/file/attribute/BasicFileAttributeView;
GVFS: OK
OpenJDK Runtime Environment 1.6.0_24 (headless)
64-bit OpenJDK 64-Bit Server VM
Linux (amd64)
Here is an example of one of the renames. There were no errors but only the to directory structure was created.

Code: Select all

[HARDLINK] Rename [/mnt/torrents/finished/NCIS.S10E01.HDTV.x264-LOL/ncis.1001.hdtv-lol/NCIS.S10E01.HDTV.x264-LOL.mp4] to [/mnt/torrents/organized/TV Shows/NCIS/Season 10/NCIS - S10E01 - Extreme Prejudice.mp4]
beeblebrox42
Posts: 3
Joined: 05 Jan 2013, 19:52

Re: Fully Automated Media Center

Post by beeblebrox42 »

Switching to OpenJDK 1.7 fixed the issue, thanks again.
paddym
Posts: 5
Joined: 07 Jan 2013, 11:26

Re: Fully Automated Media Center

Post by paddym »

Hey Folks,

Brand new Nubie here I've been thinking about automating my xbmc setup for downloading and I'm absolutely blown away by what this script says it does.
Great work!

My question is probably stupid, where do I put this actual script file? I know you have steps entering it into uTorrent etc but what about other steps like saving the script somewhere?

thanks :-)
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated Media Center

Post by rednoah »

You don't have to do anything. Just copy and paste the cmd and it'll work out of the box.

The -script fn:name argument means that FileBot will automatically grab the script from my online repository (it'll also auto-update every day).
:idea: Please read the FAQ and How to Request Help.
paddym
Posts: 5
Joined: 07 Jan 2013, 11:26

Re: Fully Automated Media Center

Post by paddym »

Wow,

That's really great stuff thank you for this great piece of work.

I'll test it out tonight and see how it gets on... Watch this space for more dunce questions ;-)

Great work,
Demerzel
Posts: 6
Joined: 07 Jan 2013, 23:10

Re: Fully Automated Media Center

Post by Demerzel »

This seems really tits..

Im wondering how i can set my output to different disks?
eg my tv is on C: and movies is on E:
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated Media Center

Post by rednoah »

Override the format expression => @see Customize Paths
:idea: Please read the FAQ and How to Request Help.
Demerzel
Posts: 6
Joined: 07 Jan 2013, 23:10

Re: Fully Automated Media Center

Post by Demerzel »

Ok, sorry for the noobiness.


So, id set for example --output /my/tv/dir
and something like: --def "movieFormat="E:movies"/{n} {y}/{fn}"
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Fully Automated Media Center

Post by rednoah »

Reading this thread should answer all your questions:
http://filebot.sourceforge.net/forums/v ... ?f=8&t=429
:idea: Please read the FAQ and How to Request Help.
SyAccursed
Posts: 1
Joined: 30 Jan 2013, 19:12

Forcing Show Names via CSV file

Post by SyAccursed »

Quite new to this tool but it is rather awesome so I thought I'd share this after working it out!

It's kind of an 'everyman' code to move and rename files into a fairly simplistic format.

Code: Select all

E:\Videos\{def a; new File('E:/Videos/names.csv').splitEachLine(';'){ if (n == it[0]) a = it[1]}; a ?: n.upperInitial().replaceTrailingBrackets()}\Season {s.pad(2)}\{es*.pad(2).join(' & ').replaceAll('null',{episode.special ? 'Special '+special.pad(2):''})} - {t.upperInitial().replaceAll(/[?.:]/).replacePart(' (Part $1)')}
Having shared this with my brother (on mac) we hit some issues with it (to do with file paths and such) and it needs to be done like this to work (basically just exact past no ~ shortcuts and swapped \ for / in the file path.

Code: Select all

/Users/Symon/Television/{def a; new File('/Users/Symon/Television/names.csv').splitEachLine(';'){ if (n == it[0]) a = it[1]}; a ?: n.upperInitial().replaceTrailingBrackets()}/Season {s.pad(2)}/{es*.pad(2).join(' & ').replaceAll('null',{episode.special ? 'Special '+special.pad(2):''})} - {t.upperInitial().replaceAll(/[?.:]/).replacePart(' (Part $1)')}
What it does is:
1) Move files into:

Code: Select all

E:/Videos/Show Name/Season 00/00 - Title
2) Has an inbuilt force show name directed at
E:/Videos/names.csv
Using the format of:

Code: Select all

Actual Show Name;Show name you want
This also proves handy for forcing extra folders in example:
Avatar: The Last Air Bender;Avatar/The Last Air Bender
The Legend of Korra;Avatar/The Legend of Korra

Causes these two shows to be neatly organised into E:/Videos/Avatar/Show Name/Season/Episode

3) Inbuilt multi-part episode handle that outputs format of

Code: Select all

01 & 02 - Title
4) Replaces part numbers on episodes with (Part 0)

5) If a special episode is included it is placed within its related Season and formatted as Special 00 - Title

6) General house-keeping. Capitalises first initials for all words on show title and episode titles + knocks out ? . and : from titles (probably could do with a few more knockced out but I just add in illegals as I find em)
Centric
Posts: 1
Joined: 31 Jan 2013, 22:59

Re: [SNIPPET] Put the "The" at the end

Post by Centric »

Thank you for this rednoah, much appreciated. I was just wondering if its possible to reverse this process for the input file? (I don't have much knowledge in this areas, if my last sentence didn't make it obvious). But if I run filebot in command prompt on "Avengers, The" is it possible to make it "The Avengers" before it tries to look up the film... I hope that made sense...

Any help would be greatly appreciated
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [SNIPPET] Put the "The" at the end

Post by rednoah »

Yes, but only with your own customised scripting. The cmdline allows you to force the query.

Though for the sake of simplicity I suggest you:
* make sure to add .nfo files with imdbid (can be generated by the artwork.* scripts).

OR
* include {imdbid} in the filename

OR
* if you renamed it before with FileBot and have "ExtendedAttributes" enabled it'll already know everything because it can read all metadata from filesystem attributes. (This is only enabled on Windows when installed via .msi and running with Java 7).
:idea: Please read the FAQ and How to Request Help.
buck3y3
Donor
Posts: 39
Joined: 05 Nov 2012, 01:19

Re: Fully Automated Media Center

Post by buck3y3 »

rednoah wrote:What's not working with serviio? Just initiating a rescan is plex/xbmc specific. If you find out how to do that with serviio I can add that.
How would I find this? I read through the api page for serviio but have no clue on how to combine it.
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: POSTBUCKET - where random posts in unrelated topics go

Post by rednoah »

Whats it say? Send http requests?
:idea: Please read the FAQ and How to Request Help.
Maxbn
Posts: 4
Joined: 12 Feb 2013, 13:37

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by Maxbn »

Hi!

Thanks for all that, I've been waiting a long time for a guide on how to use it with transmission!

I carefully followed the steps above, but when a download ends, nothing happens.
Is there any pre-requisite before doing any of this ?

About the part in the nano editor, I have two questions:

is this part in the code "output "Path/to/folder" supposed to be replaced by something ?
secondly it may be irrelevant but when I copy and paste that part, the first time i do it, only the first and third line are copied, I have to paste it a second time so that the second line appears, is that a normal behavior?

Once again thanks for working on that!
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

You can also use your favourite text editor to edit the script. It's just text.

Of course you'll need to replace this part and specify where the files will go:

Code: Select all

 --output "path/to/folder"
:idea: Please read the FAQ and How to Request Help.
Maxbn
Posts: 4
Joined: 12 Feb 2013, 13:37

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by Maxbn »

Thanks I got it to work!

For the record I installed Java, and changed the output path.

The only thing is it doesn't fetch the subtitles, which makes sense as I don't see "subtitles=en " as i see on the utorrent version.
Now my question is does all the options of the utorrent version works with this version ?
Options:
--def music=n Don't process music files
--def subtitles=en,de,fr Download subtitles for the given languages
--def artwork=n Don't fetch artwork/nfo
--def backdrops=y Fetch all available backdrops (not just one as with artwork=y)
--def xbmc=hostname Tell the given XBMC instance to rescan it's library
--def plex=hostname Tell the given Plex instance to rescan it's library
--def myepisodes=username:password Use the following MyEpisodes account to mark episodes as 'acquired'
--def pushover=userkey Send update notifications to your devices via Pushover
--def gmail=username:password Use the following gmail account to send and recieve reports
--def mailto=email Send report to the given email address (optional, email to yourself if not set)
--def ignore=regex Ignore filepaths that match the given regular expression
--def clean=y Automatically empty folders and clutter files that may be left behind after moving the video files or temporary extracted files after copying
If so do I just have to copy and paste the parts I want?
Sorry about these questions I'm a real noob, hopefully I'm not the only one and this might help others...
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by rednoah »

Yes, you can just append options to the cmdline above and it'll work:

Code: Select all

--def subtitles=en
The startup script is just glue logic between transmission and filebot. Also it's were you can set additional options for filebot and the amc script. The amc script itself is always the same, called via utorrent, transmission, or just directly from cmdline.
:idea: Please read the FAQ and How to Request Help.
Maxbn
Posts: 4
Joined: 12 Feb 2013, 13:37

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by Maxbn »

Thanks ! it works! and it's pretty awesome.
buck3y3
Donor
Posts: 39
Joined: 05 Nov 2012, 01:19

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by buck3y3 »

Maxbn wrote:Thanks I got it to work!

For the record I installed Java, and changed the output path.

The only thing is it doesn't fetch the subtitles, which makes sense as I don't see "subtitles=en " as i see on the utorrent version.
Now my question is does all the options of the utorrent version works with this version ?
Options:
--def music=n Don't process music files
--def subtitles=en,de,fr Download subtitles for the given languages
--def artwork=n Don't fetch artwork/nfo
--def backdrops=y Fetch all available backdrops (not just one as with artwork=y)
--def xbmc=hostname Tell the given XBMC instance to rescan it's library
--def plex=hostname Tell the given Plex instance to rescan it's library
--def myepisodes=username:password Use the following MyEpisodes account to mark episodes as 'acquired'
--def pushover=userkey Send update notifications to your devices via Pushover
--def gmail=username:password Use the following gmail account to send and recieve reports
--def mailto=email Send report to the given email address (optional, email to yourself if not set)
--def ignore=regex Ignore filepaths that match the given regular expression
--def clean=y Automatically empty folders and clutter files that may be left behind after moving the video files or temporary extracted files after copying
If so do I just have to copy and paste the parts I want?
Sorry about these questions I'm a real noob, hopefully I'm not the only one and this might help others...
I suppose I should have added that to the guide, but I couldn't remember if Java came with the bundle. Another thought, did you have to do anything special with your filebot install?
Maxbn
Posts: 4
Joined: 12 Feb 2013, 13:37

Re: [GUIDE] Fully Automated Media Center with Transmission (

Post by Maxbn »

Not that I can remember, I just downloaded the bundle, and installed the app without doing anything.
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

[FAQ] How can I change the filename?

Post by rednoah »

The format engine allows you to fully automatically make any kind of change to show names and episode titles via Groovy expressions.

Q: Some episodes start with '...Name' - Is it possible to ignore the dots when renaming?
A: Sure, just use after(regex) function.

Code: Select all

{t.after(/^[.]+/)}
:idea: Please read the FAQ and How to Request Help.
Omertron
Power User
Posts: 9
Joined: 14 May 2012, 14:07

Re: How about sharing our format expressions?

Post by Omertron »

This is the format that I use for YAMJ (and should work well with any other media center)

Code: Select all

..\{n.replaceFirst(/^(?i)(The|A)\s(.+)/, /$2, $1/)} {'('+y+')'}\{n} {'('+y+')'}{'.'+source}{'.'+vf}{".[CD$pi]"}{fn.match(/[.]fanart|[.]mkv/)}
All my movies are staged into a directory that I rename from and check before moving to my main movie folder.

"..\" moves the movie from it's staging directory to a correctly named folder

Code: Select all

{n.replaceFirst(/^(?i)(The|A)\s(.+)/, /$2, $1/)} {'('+y+')'}\
Renames the folder to be "name, the (year)" for better sorting

Code: Select all

{n} {'('+y+')'}{'.'+source}{'.'+vf}{".[CD$pi]"}{fn.match(/[.]fanart|[.]mkv/)}
Renames the file to be "the name (year).format.resolution.[cd#]"
gavdari
Posts: 8
Joined: 11 Mar 2013, 21:56

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Post by gavdari »

How can I manually modify the preferences file in linux? I'm trying to login into opensubtitles only (I don't have a sublight account) and when I'm running filebot -script fn:configure.login, This is what I get:

Code: Select all

Testing OpenSubtitles... OK
Testing Sublight... WebServiceException: Response indicates error: You must log in first.
javax.xml.ws.WebServiceException: Response indicates error: You must log in first.
	at net.sourceforge.filebot.web.SublightSubtitleClient.checkError(Unknown Source)
	at net.sourceforge.filebot.web.SublightSubtitleClient.getSubtitleList(Unknown Source)
	at net.sourceforge.filebot.web.SublightSubtitleClient$getSubtitleList.call(Unknown Source)
	at Script3.run(Script3.groovy:36)
	at net.sourceforge.filebot.cli.ScriptShell.evaluate(Unknown Source)
	at net.sourceforge.filebot.cli.ScriptShell.runScript(Unknown Source)
	at net.sourceforge.filebot.cli.ArgumentProcessor.process(Unknown Source)
	at net.sourceforge.filebot.Main.main(Unknown Source)
Failure (°_°)
and the files in ~/.java/.userPrefs are empty. I'm running Filebot on Ubuntu.
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Post by rednoah »

Updated the configure.login script so you can set/unset osdb or sublight.
:idea: Please read the FAQ and How to Request Help.
gavdari
Posts: 8
Joined: 11 Mar 2013, 21:56

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Post by gavdari »

Still the same.
Can you please post the contents of a sample Pref file? I can manually edit the files in ~/.java/.userPref for open subtitles login data, can't I?
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Post by rednoah »

Make sure you get my updates immediately:

Code: Select all

filebot -clear-cache -script fn:configure.login
:idea: Please read the FAQ and How to Request Help.
gavdari
Posts: 8
Joined: 11 Mar 2013, 21:56

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Post by gavdari »

Ok so now it seems to work fine:

Code: Select all

Testing OpenSubtitles... OK
Done ヾ(@⌒ー⌒@)ノ
But still, when I'm trying to download subtitles, this is what I get:

Code: Select all

WARNING: Not in GZIP format: anti-leech limit may have been reached
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Post by rednoah »

When it said "Testing OpenSubtitles... OK" it had already configured and setup your user. From then on FileBot was using your user.

Just because you're logged in doesn't mean OpenSubtitles gives you infinite quotas. Try again tomorrow. Or talk to the devs and make a seizable donation. ;)
:idea: Please read the FAQ and How to Request Help.
gavdari
Posts: 8
Joined: 11 Mar 2013, 21:56

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Post by gavdari »

Oh, thank you. I thought if I login I'll have unlimited quota. Sorry for the trouble.
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Post by rednoah »

Honestly I have no idea, it keeps changing. Though I have the feeling that since I donated 15 euro and got a VIP account I run into those limits much less.
:idea: Please read the FAQ and How to Request Help.
gavdari
Posts: 8
Joined: 11 Mar 2013, 21:56

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Post by gavdari »

And apparently it's not some specific number of downloads per hour/day. I have this large collection of TV subtitles and I need to download all the subtitles for my brother. Sometimes I can download more than 200 subtitles in one session, and sometimes it starts playing out after a season or two.
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: Automated Media Center

Post by dacari »

Filebot is the final chapter of the holygrail.

Holly Moses....CouchPotato+Utorrent+Filebot+YamJ=Slick as Shit!...I need some help customizing this script as follows:

1. I know Utorrent locks the file, but is there way to move instead of copy?
2. Can it set it to download the NFO file only and not any poster art, or have them removed
3. Customize the output folder name from "Movies"?

Appreciate any help that can assisted.

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

Re: Automated Media Center

Post by rednoah »

1. No, only with lots of extra effort and interfacing with utorrent. Why not use hardlinks?
2. No, not by default. And Yes, but you'll need to modify the scripts.
3. RTFM ;)
:idea: Please read the FAQ and How to Request Help.
verysofttoiletpaper
Posts: 141
Joined: 05 Jul 2012, 09:44

Re: Automated Media Center

Post by verysofttoiletpaper »

dacari wrote:Filebot is the final chapter of the holygrail.

Holly Moses....CouchPotato+Utorrent+Filebot+YamJ=Slick as Shit!...I need some help customizing this script as follows:

1. I know Utorrent locks the file, but is there way to move instead of copy?
2. Can it set it to download the NFO file only and not any poster art, or have them removed
3. Customize the output folder name from "Movies"?

Appreciate any help that can assisted.

Regards.
What do you use YamJ for and how do you use it?
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: Automated Media Center

Post by dacari »

@rednoah

1. Thanks
2. Thanks
3. KMA ;)

@verysofttoiletpaper

Yamj is a code for downloading info & indexing for NMT players:

http://code.google.com/p/moviejukebox/
User avatar
ashfallen0
Power User
Posts: 32
Joined: 14 Jan 2012, 10:44

Re: Automated Media Center

Post by ashfallen0 »

dacari:
#1:

Code: Select all

--action move

I personally have great success with this. My utorrent is set to download (with .ut) to a partial directory, then move on complete to a competed directory, which is where filebot takes over and moves that to the clean directory after rename. It allows me to monitor failed launches of the filebot script and re-run from the logger entry to diagnose. The torrent HAS to be stopped for that to work. Preferences: Queueing: "When utorrent reaches the seeding goal" Enable checkbox "Limit the upload rate to (kB/s): [0 = stop] Change that to 0. That will allow you to seed to a good ratio, then discontinue and unlock the file.

#3: rednoah is saying that he defined the script to use the relative directory, so if you use:

Code: Select all

--def "movieFormat=Movies/{n} {y}/{fn}"
and change that to what ever you want that directory to be e.g

Code: Select all

--def "movieFormat=Films/{n} {y}/{fn}"
it will add a subdirectory named X:/OutputDir/Films/
dacari
Donor
Posts: 44
Joined: 20 Mar 2013, 14:42

Re: Automated Media Center

Post by dacari »

Thank you ashfallen0,

Ahh this is great...I also tried the fbcpto.groovy script but could not get it to work. Couple little questions as I am a noob.

1. What do you mean by (.ut)
2. Would you be able to advise how to modify the script so that only the NFO file is created and not any poster art.

This is what I have:

Code: Select all

filebot -script fn:amc --output "\\NAS\Volume_2\Media\Movies" --action move --conflict override -non-strict --def music=n subtitles=en artwork=n "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S" "clean=y" --def "movieFormat=Films/{n} {y}/{fn}"


Thanks Much
User avatar
ashfallen0
Power User
Posts: 32
Joined: 14 Jan 2012, 10:44

Re: Automated Media Center

Post by ashfallen0 »

1: Preferences: General: "When downloading": checkbox "Append .!ut to incomplete files". Not really sure if it's necessary, but it allows me a visual of what is downloading but not complete, in case any files don't get moved by utorrent or the computer crashes/power failure.
2: Sorry, you're going to have to find a scripting guru. I wouldn't even know where to begin.
Image PHPBB3 hates me.
DG77
Posts: 4
Joined: 28 Mar 2013, 10:01

Re: Automated Media Center

Post by DG77 »

Is it possible to adjust the script to organize only TVShows, and for everything else just unzip into current (download) folder?

Thanks :)
Karanlik
Posts: 2
Joined: 31 Mar 2013, 07:48

Re: Automated Media Center

Post by Karanlik »

Foa,I met with Filebot and your script yesterday and thanks for hardwork.

I tried to use with Vuze via command runner plug in.

Since there is no %S defination in command runner, i only disabled this part of your script in my local drive.

Code: Select all

// check user-defined pre-condition
// if (tryQuietly{ ut_state ==~ ut_state_allow }) {
//	throw new Exception("Invalid state: ut_state = $ut_state (expected $ut_state_allow)")
// }
and here is my command
filebot.exe -script "C:/Program Files/FileBot/amc.groovy" --output "G:/AFTER" --action copy --conflict override -non-strict --def "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L"
It extract the G:\AFTER directory without problem. But that's all. Extracted part in orgjinal directory remains undeleted and there is no sub or artwork. Seems like script doesn't work after extracting part.

I also tried to copy other script in amc.groovy and changed script like this. (I don't know if it's right way of coding groovy).
i.e

Code: Select all

if (pushover) {
	// include webservice utility
	include('C:/Program Files/FileBot/ws.groovy')
	
	_log.info 'Sending Pushover notification'
	Pushover(pushover).send("Finished processing ${tryQuietly { ut_title } ?: input*.dir.name.unique()} (${getRenameLog().size()} files).")
}
again i stucked after extracting and copying part.

Do you any idea how i can make work other parts of script also?
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automated Media Center

Post by rednoah »

You don't need to change anything, and the lines you commented out have no affect anyway if you don't pass in ut_state_allow.

Most importantly you'll first need to check Vuzes log or something for what command it's actually executing, after variables have been replaced etc

Changing the script without checking what the command and output is, is pretty much useless since you're working blind.
:idea: Please read the FAQ and How to Request Help.
Karanlik
Posts: 2
Joined: 31 Mar 2013, 07:48

Re: Automated Media Center

Post by Karanlik »

Ok, I stucked after extracting and copying part because i didn't use option on command.
Now i can confirm that your script works like a charm on Azureus (Vuze, with command runner plugin).

Only mail part doesn't work. When i tried to run in command line, it says i should look "http://mail.google.com/support/bin/answ ... swer=14257 ". I tried suggestion there but i didn't work but it isn't so important i think.

What i wonder is if it's possible to get ripper group name or torrent name in info file or somewhere like that.

Thanks again for the great app and script.
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automated Media Center

Post by rednoah »

Email works. You probably pass in the wrong values. Note that by username I do mean username, not email address, which would be [email protected]

The other stuff you can add yourself if you're ok with a bit of groovy code.
:idea: Please read the FAQ and How to Request Help.
f3nc3r
Posts: 1
Joined: 06 Apr 2013, 23:29

Re: Automated Media Center

Post by f3nc3r »

Rednoah

Thanks for all your support- this is a really amazing program.

I'm trying to set filebot up with my vuze installation (as I feel uncomfortable running utorrent w/o peer blocking), and was wondering if there is a way to automatically rename some tv series by season-episode and some by airdate- specifically considering the daily show and the colbert report.

If it helps, I can automatically assign a different category for the by airdate series.
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automated Media Center

Post by rednoah »

It's all in the episode naming scheme. Just something along the lines of {n ==~ /Daily.Show/ ? airdate : s00e00} so very very easy.
:idea: Please read the FAQ and How to Request Help.
paddym
Posts: 5
Joined: 07 Jan 2013, 11:26

Re: Automated Media Center

Post by paddym »

Hi all,

I've been using this script for the past few months and it's brilliant! Really I couldn't be more grateful this is fantastic work.
I've been running it straight from utorrent posprocess and for some reason lately it's stopped working.

A movie or TV show downloads and nothing happens, the log out put in utorrent shows that the commands are being called but just nothing happens. I've added the filebot.log output too but the file isn't created.
I've tried to do some troubleshooting myself and I find that running a manual command works so this script is doing it's job, it's got to be something to do with uTorrent. Anyone seen this at all? It's so frustrating!

Any help is appreciated.

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

Re: Automated Media Center

Post by rednoah »

Check the docs again. Things changed a bit with v3.5, so if you redirect output you'll need to force utorrent to call with cmd. With v3.6 that i'll push on the weekend it'll get more streamlined and should then be stable.
:idea: Please read the FAQ and How to Request Help.
paddym
Posts: 5
Joined: 07 Jan 2013, 11:26

Re: Automated Media Center

Post by paddym »

Thanks for the response!

Where are the docs? I'm reading the original post and I don't see any link to documents? Sorry if I'm being stupid I'm genuinely not being lazy :-)

My script looks the same as the first post, also I notice it appears to be picking up files to try and unzip or move which it shouldn't. For example it seems to have picked up the sample file.
paddym
Posts: 5
Joined: 07 Jan 2013, 11:26

Re: Automated Media Center

Post by paddym »

Sorry I see what you were referring to now,

This is strange, it works from the command line directly though? I'll try this change thanks for pointing it out.

P
isadic
Posts: 3
Joined: 25 Apr 2013, 12:17

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Post by isadic »

Movie detection failed in:
[BluRay Rip 1080p - ITA-ENG DTS-AC3-SUB] Machete (2011) LiFE [M@HD].mkv

that is detected as 'Machete 2011 LiFE M'

I suppose it's the fault of:
LiFE
[M@HD]

Can you add these terms to the blacklist?

EDIT:
The year isn't recognized too in v3.6...can you look into this?
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Post by rednoah »

Added.

But even without it does get it right:

Code: Select all

Parameter: ut_kind = multi
Parameter: ut_dir = D:\testdata\AMC-TEST
Parameter: ut_title = AMC-TEST
Input: D:\testdata\AMC-TEST\[BluRay Rip 1080p - ITA-ENG DTS-AC3-SUB] Machete (2011) LiFE [M@HD].mkv
[BluRay Rip 1080p - ITA-ENG DTS-AC3-SUB] Machete (2011) LiFE [M@HD].mkv [series: LiFE, movie: Machete (2010)]
Exclude Series: LiFE
Group: [tvs:null, mov:Machete (2010), anime:null] => [[BluRay Rip 1080p - ITA-ENG DTS-AC3-SUB] Machete (2011) LiFE [M@HD].mkv]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [D:\testdata\AMC-TEST\[BluRay Rip 1080p - ITA-ENG DTS-AC3-SUB] Machete (2011) LiFE [M@HD].mkv]
[COPY] Rename [D:\testdata\AMC-TEST\[BluRay Rip 1080p - ITA-ENG DTS-AC3-SUB] Machete (2011) LiFE [M@HD].mkv] to [D:\output\Movies\Machete (2010)\Machete (2010).mkv]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Post by rednoah »

Movie Machete (2010)
www.imdb.com/title/tt0985694

6min TV Series Machete (2011)
http://www.imdb.com/title/tt2112196/

I'm pretty sure we're taking about Machete (2010) here. Works as expected. Better than even. :D
:idea: Please read the FAQ and How to Request Help.
isadic
Posts: 3
Joined: 25 Apr 2013, 12:17

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Post by isadic »

Yes I was talking about the film...and yes now is working...I'm a little confused about that xD
I don't know why before posting my report the software didn't recognized the film.
Thanks a lot for the support xD
wisomtooth
Posts: 6
Joined: 02 May 2013, 05:49

Re: [SNIPPET] Put the "The" at the end

Post by wisomtooth »

Can we integrate this into that:
http://www.filebot.net/forums/viewtopic ... &t=5#p2211

How?
wisomtooth
Posts: 6
Joined: 02 May 2013, 05:49

Re: How about sharing your CLI scripts?

Post by wisomtooth »

On "Rename All Media Folder by Folder":

1. The script is not renaming the media files inside folders for me.

2. Some titles get renamed to their English equivalent, some don't (even when available).

e.g. "Kasi az gorbehaye irani khabar nadareh" doesn't rename to "No One Knows About Persian Cats" (http://www.imdb.com/title/tt1426378/)

I'm using IMDB as source.
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [SNIPPET] Put the "The" at the end

Post by rednoah »

Code: Select all

--format "your/format/anything"
You just need to make sure you correctly pass the value and escape and quote things as necessary.
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How about sharing your CLI scripts?

Post by rednoah »

1. It's not supposed to. Just run it twice if you first wanna rename folders and then files. If you restructure your stuff you'd normally define a format for that and move everything into the new structure rather then renaming files in place.

2. Depends on the database you're using. TMDB respects the --lang option. With IMDb you'll get what you get regardless of your prefs.
:idea: Please read the FAQ and How to Request Help.
Opthimus
Posts: 1
Joined: 06 May 2013, 10:40

Re: Automated Media Center

Post by Opthimus »

You are a life saver! XD

Thank you so much!
jtrotter
Posts: 1
Joined: 13 May 2013, 23:29

Re: Automated Media Center

Post by jtrotter »

I have been using this successfully to rename and move my downloads to a specific location. It was working well, and it still is when i download a torrent manually. however, it no longer works with my RSS feed. When a torrent is downloaded through my feed into the same place as a manual torrent, the filebot script runs but it does not rename or move the file. I'm not sure what is going on. any thoughts? I'm using utorrent. Thanks.
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Automated Media Center

Post by rednoah »

*** If you need help start a new thread and always include cmdline output! ***
Definitely doesn't have anything to do with RSS feeds or whatnot. It's a simple cmdline tool that processes files.
:idea: Please read the FAQ and How to Request Help.
AnIdeaWithin
Posts: 6
Joined: 12 May 2013, 16:29

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Post by AnIdeaWithin »

How about allowing the user to add user defined blacklist terms? I'm imagining that in a local "user-query-blacklist.txt". That way, filebot could be tailored to individual system infrastructures. On my NAS, e.g., I keep the unprocessed files in folders à la "_to_be_sorted_SERIES" or "_to_be_sorted_MOVIES", and filebot tries to match the "to" of that folder name, which leads to a whole bunch of utterly unwanted matches. Easy workaround: Get rid of the underscores. There's no "tobesortedXXX" available in the movie / series DBs, so it doesn't try to match those. But still, I'd be quite happy if I could tinker with the settings on my end in this case, as I don't see it would be much use to include this highly individual path name choice in the general public rules.
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Post by rednoah »

Added to.be.sorted pattern.

You can always override the *.properties files in the jar and then use your own data files. But it's already full of individual stuff. However wierd it may be, I'm sure there's lots of other people that use the same naming. So I don't mind adding things like this. Makes sense to me.
:idea: Please read the FAQ and How to Request Help.
AnIdeaWithin
Posts: 6
Joined: 12 May 2013, 16:29

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Post by AnIdeaWithin »

Somehow doesn't seem "clean" to me, but it's your baby, and if it works for me, I won't complain :)

Anyway, all the superspeedy and HELPFUL support convinced me to make a donation. Keep up the good work!
AnIdeaWithin
Posts: 6
Joined: 12 May 2013, 16:29

Transmission on Synology NAS

Post by AnIdeaWithin »

Hint for Synology users: The transmission installation sets up a user "transmission" with his own home dir. This home dir is "/usr/local/transmission/var", thus the config files can be found there:

Code: Select all

vi /usr/local/transmission/var/settings.json
This will work only if logged in as root. As admin, you'll have to prefix that with sudo, as most linux users will already know (sudo requires some extra setup on Synology though, you'll have to google for that or pm me).
@rednoah: If you think this is the wrong place for this extra info, feel free to move or delete the posting.
d3x
Posts: 7
Joined: 25 May 2013, 03:53

Re: How about sharing your CLI scripts?

Post by d3x »

http://filebot.net/scripts/artwork.tmdb.groovy

I have all my movies in one folder. I am trying to modify the script to work with my setup but am failing horribly. I also only want the XML information and a single poster for each both (named the same as the movie just with .xml and .jpg extensions.)
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How about sharing your CLI scripts?

Post by rednoah »

The artwork.* scripts define mostly how the folder structure is traversed and how movie/series detection works. The actual artwork downloading and naming is all in the lib/htpc include.

Best thing to do is to organize each movie into it's own folder.
:idea: Please read the FAQ and How to Request Help.
d3x
Posts: 7
Joined: 25 May 2013, 03:53

Re: How about sharing your CLI scripts?

Post by d3x »

I can read the scripts no problem I just can't write changes very well as my Java is weak and Groovy is non existent.

Code: Select all

options = options.sortBySimilarity(query, { it.name })
Where is sortBySimilarity defined? Does it.name really need the { and } around it?
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How about sharing your CLI scripts?

Post by rednoah »

Here's the stuff I pre-define:
https://sourceforge.net/p/filebot/code/ ... force=True

The { ... } is the toString function used for comparison. It's passing in a function, not a value. So you need the { ... }
:idea: Please read the FAQ and How to Request Help.
d3x
Posts: 7
Joined: 25 May 2013, 03:53

Re: How about sharing your CLI scripts?

Post by d3x »

Code: Select all

args.getFiles{ it.isVideo() }
.each{
def movieName = detectMovie(it, false)
def movieInfo = TheMovieDB.searchMovie(movieName.name, _args.locale).sortBySimilarity(movieName.name, {it.name})[0]
println movieInfo
}
Seems to be working okay except Kiss.Kiss.Bang.Bang.2005.DVDRip.x264.AC3-SiC.mp4 is being identified as Kiss Kiss... Bang Bang (1966)
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How about sharing your CLI scripts?

Post by rednoah »

You first have filebot correctly detect it as Kiss Kiss Bang Bang (2005) via detectMovie(), then you go on and take only the movie name Kiss Kiss Bang Bang and do another search, that is completely useless btw, at best giving you the same result, at worst a different movie.

You only need detectMovie() and it'll get you the best-guess movie object with name/year/tmdbid.
:idea: Please read the FAQ and How to Request Help.
d3x
Posts: 7
Joined: 25 May 2013, 03:53

Re: How about sharing your CLI scripts?

Post by d3x »

Code: Select all

args.getFiles{ it.isVideo() }
.each{
def movieName = detectMovie(it, false)
println movieName
def movieInfo = TheMovieDB.searchMovie(movieName.name, _args.locale)
println movieInfo
println movieInfo.sortBySimilarity(movieName.toString(), {it.name})
}
Kiss Kiss Bang Bang (2005)
[Kiss Kiss... Bang Bang (1966), Kiss Kiss Bang Bang (2005), Kiss Kiss (Bang Bang) (2001)]
[Kiss Kiss... Bang Bang (1966), Kiss Kiss Bang Bang (2005), Kiss Kiss (Bang Bang) (2001)]
sortBySimilarity is not working movieName.toString() is exactly "Kiss Kiss Bang Bang (2005)" yet it does not move it to the front of array.
User avatar
rednoah
The Source
Posts: 24649
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How about sharing your CLI scripts?

Post by rednoah »

It's sorting by the text similarity of movieName.toString() and it.name, since the ... is ignored both match equally by name, and since you do it.name you specifically make sure the year part is not part of the equasion. Just do sortBySimilarity(string) and let it use the default toString function for the comparison value.

Also, detectMovie already gives you the best result. If you use detectMovie it's a complete waste to do a TMDb.searchMovie afterwards. It's probably called internally as part of detectMovie already anyway, relevance sorting as well.
:idea: Please read the FAQ and How to Request Help.
d3x
Posts: 7
Joined: 25 May 2013, 03:53

Re: How about sharing your CLI scripts?

Post by d3x »

I am doing TMDb.searchMovie() because I would like to pull a couple more details but I think I will just write the movie name to file then use a more reasonable language to do the rest like I had originally planned.

Code: Select all

import groovy.json.JsonBuilder
args.getFiles{ it.isVideo() }.each{
 def f = new File(it.name[0..-5] + '.json')
 if (f.exists())
  return
 def m = detectMovie(it, false)
 f.write(new JsonBuilder(m).toPrettyString())
}
Thanks for all the help and fast replies

Edit: I just realized detectMovie gets the tmdbId so I can just use TheMovieDB.getMovie() lol
Post Reply