Page 3 of 11

Re: How about sharing your CLI scripts?

Posted: 26 May 2013, 07:20
by rednoah
searchMovie only gives you name/year/id movie descriptors, this will give you all the metadata:

Code: Select all

println TheMovieDB.getMovieInfo(detectMovie(f, false), Locale.ENGLISH)

Re: [CODE] Force series for specific files

Posted: 26 May 2013, 14:19
by sjboyd891
rednoah wrote:Sometimes it might be useful to override series auto-detection by forcing a series title for a specific set of files. This is how you do it. Only process a certain set of files via file parameter and force the series title via the query parameter.

Code: Select all

rename(file: args.getFiles{ it =~ /(?i:colbert.report)/}, query: "The Colbert Report", db: "TheTVDB")
rename(file: args.getFiles{ it =~ /(?i:daily.show)/}, query: "The Daily Show with Jon Stewart", db: "TheTVDB")
...
Where do I use this script? Do I use it in the same Filebot regular cmd line or with utorrent?

Re: [CODE] Examples and Snippets

Posted: 26 May 2013, 14:31
by rednoah
That's just code snippets. You write your script.groovy and then run it with -script your/script.groovy

Re: Automated Media Center

Posted: 05 Jun 2013, 18:05
by grande7e7
Great read. Fantastic work, but a noob here :(

Under step 1 for setting up utorrent on Windows, do I simply copy the text there and paste it in the utorrent box for everything to run? I've don exactly that, changed path name too but nothing happens.

Any help would be much appreciated!

Re: How about sharing our format expressions?

Posted: 10 Jun 2013, 04:17
by danielsokolowski
Here are mine used in a CLI script and as a callback when downloads finish:

1. Append a list of genres to the movies - :

Code: Select all

"movieFormat=Movies/{n} ({y}) {genres}/{n} ({y}) {genres}{\" CD$pi\"}{\".$lang\"}"

ex: Media Library\Movies\12 Rounds (2009) [Action, Adventure, Drama, Thriller]\12 Rounds (2009) [Action, Adventure, Drama, Thriller].avi

2. Append a list of genres of a tv serices and add year if year not already in series name (it does this by removing the year from title using replace function):

Code: Select all

"seriesFormat=TV Shows/{n.replaceAll(\" \\(\" + y + \"\\)\",\"\")} ({y}) {genres}/{episode.special ? \"Special\" : \"Season \"+s.pad(2)}/{n} - {episode.special ? \"S00E\"+special.pad(2) : s00e00} - {t.replaceAll(/[\`\Â\´\â\€\˜\\â\€\™\Ê\»]/, \"'\").replaceAll(/[!?.]+$/).replacePart(', Part $1')}{\".$lang\"}"


ex: Media Library\TV Shows\Battlestar Galactica (2003)  [Action, Adventure, Drama, Science-Fiction]\Season 01\Battlestar Galactica (2003) - S01E12 - .avi
ex: Media Library\TV Shows\Fringe (2008) [Drama, Science-Fiction]\Season 01\Fringe - S01E01 - Pilot.avi

Re: Automated Media Center

Posted: 11 Jun 2013, 17:02
by cheesemaker
Can you add Command-Line-Support for disabling automatic unrar? Thanks :)

Re: Automated Media Center

Posted: 11 Jun 2013, 17:35
by cheesemaker
hey,
If your format contains quotes, e.g. {"-$fn"}, and you just copy and paste it, e.g. "movieFormat={"-$fn"}", the quotes in the format will mess with cmdline argument parsing. Hence you MUST ESCAPE DOUBLE QUOTES, e.g. "movieFormat={\"-$fn\"}".
Here my simplified code:

Code: Select all

filebot -script fn:amc "./" --output "/mnt/media/" --action test -non-strict --conflict override --def "movieFormat=Filme/{n.upperInitial().space('.')}.{y}/{n.upperInitial().space('.')}.{y}{\"-$group\"}" clean=y music=n subtitles=y artwork=n "ut_dir=" "ut_file=" "ut_kind=" "ut_title=" "ut_label=" "ut_state="
Namin scheme in hardcoded script works fine. Trying to get it working with auto update...
But it doesn't works. Output (with three sample movies:

Code: Select all

root@download01:/mnt/media/Movies# filebot -script fn:amc "./" --output "/mnt/media/" --action test -non-strict --conflict override --def "movieFormat=Filme/{n.upperInitial().space('.')}.{y}/{n.upperInitial().space('.')}.{y}{\"-$group\"}" clean=y music=n subtitles=y artwork=n "ut_dir=" "ut_file=" "ut_kind=" "ut_title=" "ut_label=" "ut_state="
Parameter: movieFormat = Filme/{n.upperInitial().space('.')}.{y}/{n.upperInitial().space('.')}.{y}{"-"}
Parameter: clean = y
Parameter: music = n
Parameter: subtitles = y
Parameter: artwork = n
Parameter: ut_dir = 
Parameter: ut_file = 
Parameter: ut_kind = 
Parameter: ut_title = 
Parameter: ut_label = 
Parameter: ut_state = 
Argument: /mnt/media/Movies
Input: /mnt/media/Movies/Forrest.Gump.1994.German.AC3.1080p.BluRay.x264-SEKTiON9.sub
Input: /mnt/media/Movies/From.Hell.2001.1080p.BluRay.DTS.DL.x264-HDC.mkv
Input: /mnt/media/Movies/xXx.2002.1080p.BluRay.DTS.DL.x264-HDC.mkv
Forrest.Gump.1994.German.AC3.1080p.BluRay.x264-SEKTiON9.sub [series: null, movie: Forrest Gump (1994)]
From.Hell.2001.1080p.BluRay.DTS.DL.x264-HDC.mkv [series: null, movie: From Hell (2001)]
xXx.2002.1080p.BluRay.DTS.DL.x264-HDC.mkv [series: null, movie: xXx (2002)]
Group: [tvs:null, mov:Forrest Gump (1994), anime:null] => [Forrest.Gump.1994.German.AC3.1080p.BluRay.x264-SEKTiON9.sub]
Group: [tvs:null, mov:From Hell (2001), anime:null] => [From.Hell.2001.1080p.BluRay.DTS.DL.x264-HDC.mkv]
Group: [tvs:null, mov:xXx (2002), anime:null] => [xXx.2002.1080p.BluRay.DTS.DL.x264-HDC.mkv]
No missing subtitles
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/mnt/media/Movies/Forrest.Gump.1994.German.AC3.1080p.BluRay.x264-SEKTiON9.sub]
[TEST] Rename [/mnt/media/Movies/Forrest.Gump.1994.German.AC3.1080p.BluRay.x264-SEKTiON9.sub] to [/mnt/media/Filme/Forrest.Gump.1994/Forrest.Gump.1994-.sub]
Processed 1 files
Get [English] subtitles for 1 files
Looking up subtitles by filehash via OpenSubtitles
Looking up subtitles by filehash via Sublight
Lookup by hash failed: java.lang.IllegalStateException: Sublight login has not been configured
Searching for [From Hell] at [OpenSubtitles]
Searching for [From Hell] at [Sublight]
Search for [From Hell] failed: Sublight login has not been configured
Searching for [From Hell] at [Subscene]
No matching subtitles found: /mnt/media/Movies/From.Hell.2001.1080p.BluRay.DTS.DL.x264-HDC.mkv
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/mnt/media/Movies/From.Hell.2001.1080p.BluRay.DTS.DL.x264-HDC.mkv]
[TEST] Rename [/mnt/media/Movies/From.Hell.2001.1080p.BluRay.DTS.DL.x264-HDC.mkv] to [/mnt/media/Filme/From.Hell.2001/From.Hell.2001-.mkv]
Processed 1 files
Get [English] subtitles for 1 files
Looking up subtitles by filehash via OpenSubtitles
Looking up subtitles by filehash via Sublight
Lookup by hash failed: java.lang.IllegalStateException: Sublight login has not been configured
Exception: Failed to auto-detect query
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/mnt/media/Movies/xXx.2002.1080p.BluRay.DTS.DL.x264-HDC.mkv]
[TEST] Rename [/mnt/media/Movies/xXx.2002.1080p.BluRay.DTS.DL.x264-HDC.mkv] to [/mnt/media/Filme/XXx.2002/XXx.2002-.mkv]
Processed 1 files
Done ヾ(@⌒ー⌒@)ノ
//EDIT:

Code: Select all

 --def "movieFormat=Filme/{n.upperInitial().space('.')}.{y}/{n.upperInitial().space('.')}.{y}{$vc}"
Only {$vc} also don't work. {vc} works. Looks like it can't manage the conditional function in command line mode...

Re: Automated Media Center

Posted: 12 Jun 2013, 17:24
by curl
Hey there,

great piece of software you've built. Thanks a lot!
Only wish i'd discovered it sooner :)
But this script is acutally giving me a bit of a headache.

First, i keep getting a bunch of these in my cmdline output:

Code: Select all

Failed to write xattr: java.io.File.toPath()Ljava/nio/file/Path;
And secondly, this one line

Code: Select all

WARNUNG: Unable to inherit IO: java/lang/ProcessBuilder$Redirect
Any of those something i need to worry about?

Oh, and btw, anyone have a good tutorial or documentation on fpcalc?
I would love to have AMC sort my audiofiles as well, but as of now, i can't seem to get a handle on that fpcalc thingy.

Thanks.

Re: Automated Media Center

Posted: 14 Jun 2013, 01:12
by rednoah
Use Java 7 if possible. But it'll still work with Java 6 except with some warnings.

The fpcalc command needs to be in the PATH or /usr/bin or something. Just so it can find the command.

Re: Automated Media Center

Posted: 14 Jun 2013, 17:05
by rednoah
cheesemaker wrote:Only {$vc} also don't work. {vc} works. Looks like it can't manage the conditional function in command line mode...
It's either {vc} or {"$vc"}.

PS: CMD escaping sucks, i'm pretty much just trying around until it works as well.

Re: Automated Media Center

Posted: 15 Jun 2013, 08:59
by cheesemaker
rednoah wrote:
cheesemaker wrote:Only {$vc} also don't work. {vc} works. Looks like it can't manage the conditional function in command line mode...
It's either {vc} or {"$vc"}.

PS: CMD escaping sucks, i'm pretty much just trying around until it works as well.
Ok, Thanks, I managed it. For an item, which will be only added when it's given and have a separator '.', the cmd code is:

Code: Select all

{\".\$vc\"}
best regards,
cheesemaker

Re: Automated Media Center

Posted: 26 Jun 2013, 14:39
by phDave
Hi folks

Almost got this working but always seems to hang just after:

Code: Select all

Rename movies using [TheMovieDB]
[COPY] Rename [M:\Movies\blahblah.avi] to [M:\Movies\Blah Blah (2001).avi]
could this be because M: is a network drive accessed by WiFi and blahblah is a big file?
Is it really doing a COPY-DELETE rather than a RENAME? (I guess it might, othewise how can it move blahblah whilst it's still seeding?)

Thanks in advance, awesomely clever piece of SW.

Re: Automated Media Center

Posted: 26 Jun 2013, 16:11
by rednoah
You've set --action copy so it's gonna copy...

[COPY] => COPY (copy as in copy, no delete)
[MOVE] => MOVE (as in rename)

How exactly that operation is performed is platform dependent.


You probably wanna look into using --action hardlink and/or running filebot on that smb server.

Understanding hardlinks:
http://en.wikipedia.org/wiki/Hard_link

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 27 Jun 2013, 03:50
by phDave
You've set --action copy so it's gonna copy...
Duh - thanks! - will RTFM. Linking sounds safest - leave the source where it is and point to it. SMB server is an ACRyan media player so not much chance of running on there I don't think.

Thx for the response.

Re: Automated Media Center

Posted: 01 Jul 2013, 14:29
by andrewtdop
Could I ask for some help please?

I have run the script you suggested, and it worked for some time, but now I get an error. I'm kinda new at this, so bear with me... Below is the script I used and the error log. Any help would be appreciated. Thanks in advance.

SCRIPT:

"C:/Program Files/Filebot/filebot.exe" -script fn:amc "Z:/Downloads" --output "Z:/" --log-file amc.log --action copy --conflict override -non-strict --def music=n artwork=y "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S" --def xbmc=HOST --def gmail=Username:Password --def mailto=[email protected] --def clean=y


LOG:


Parameter: music = n
Parameter: artwork = y
Parameter: ut_dir = F
Parameter: ut_kind = N
Parameter: ut_label = S
Parameter: xbmc = HOST
Parameter: gmail = User:Password
Parameter: mailto = [email protected]
Parameter: clean = y
Argument: Z:\Downloads
Exception: Conflicting arguments: pass in either file arguments or ut_dir/ut_file parameters but not both
Failure (°_°)

Re: Automated Media Center

Posted: 01 Jul 2013, 14:41
by rednoah
RTFM
Standalone Usage
You can use the script directly from the cmdline like this, by just adding files as arguments instead of the utorrent parameters.
@see http://www.filebot.net/forums/viewtopic ... =793#p5114

Re: Automated Media Center

Posted: 01 Jul 2013, 17:14
by andrewtdop
Thanks, I've tried that and it works (mostly) but I really want this to run after the torrent downloads in utorrent.

Any help??

Re: Automated Media Center

Posted: 02 Jul 2013, 04:10
by rednoah
RTFM @see http://www.urbandictionary.com/define.php?term=RTFM

µTorrent usage:
µTorrent -> Run Program -> Run this program when torrent finishes:

Code: Select all

filebot -script fn:amc --output "X:/path/to/media" --log-file amc.log --action copy --conflict override -non-strict --def music=y subtitles=en artwork=y "ut_dir=%D" "ut_file=%F" "ut_kind=%K" "ut_title=%N" "ut_label=%L" "ut_state=%S"

Re: Automated Media Center

Posted: 03 Jul 2013, 02:56
by andrewtdop
Wow, thanks. That's what I had before that didn't work. And it still doesn't. Appreciate it.

Re: Automated Media Center

Posted: 03 Jul 2013, 03:04
by andrewtdop
I've tried every variation I can think of for this, beginning with the original code provided "in the manual" and it worked and then suddenly, with no system changes, stopped working. Seriously, I read the manual, understand how this works and am looking for real help. If you're willing, I'd appreciate it.

Since it stopped working, I get this in the log:

Code: Select all

Parameter: music = y
Parameter: subtitles = en
Parameter: artwork = y
Parameter: ut_dir = F
Parameter: ut_kind = N
Parameter: ut_label = S--def
Parameter: xbmc = HOST
Parameter: gmail = user:pass
Parameter: mailto = [email protected]
Parameter: clean = y
MissingPropertyException: No such property: ut_file for class: Script3
groovy.lang.MissingPropertyException: No such property: ut_file for class: Script3
	at Script3.run(Script3.groovy:78)
	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 (°_°)
Parameter: music = y
Parameter: subtitles = en
Parameter: artwork = y
Parameter: ut_dir = F
Parameter: ut_kind = N
Parameter: ut_label = S
Parameter: xbmc = HOST
Parameter: gmail = user:pass
Parameter: mailto = [email protected]
Parameter: clean = y
Argument: Z:\Downloads
Exception: Conflicting arguments: pass in either file arguments or ut_dir/ut_file parameters but not both
Failure (°_°)

Re: Automated Media Center

Posted: 03 Jul 2013, 05:29
by rednoah
This is how a good call looks like:

Code: Select all

filebot -script fn:amc --output "D:/Organized Media" --log-file amc.log --action hardlink --conflict override -non-strict --def "ut_dir=D:\Media\Avatar" "ut_file=" "ut_kind=multi" "ut_title=Avatar" "ut_label=" "ut_state=5"
WHAT IS THIS?

Code: Select all

Parameter: ut_dir = F
I explain: %var are variables for utorrent. They will be replaced with actual values, as in the statement above. You're obviously doing something wrong. Did you just copy and paste the statement into the cmd? I can see that you did. RTFM. It tell you to check the utorrent Logger for the command that is executed by utorrent, not the template you paste into utorrent.

If this is the output you get, something is seriously not working (or you're doing it wrong). How can FileBot know where the newly finished torrent is? It's in F ??? F ??? Of course not. %F should resolved to something like D:\Media\Avatar by utorrent before filebot is even called:

Code: Select all

Parameter: ut_dir = F <-- WRONG, OBVIOUSLY
Parameter: ut_kind = N
Parameter: ut_label = S
Clear? This is when I say utorrent usage.


If you check the sample cmdline for utorrent THERE IS NEVER a file argument? What is a file argument? It's path that you just add that is not a regular cmdline option or --def option, just arguments you add. In your case that's Z:\Downloads. You will see that im my utorrent sample there is no such random file argument.

This is a log for standalone usage (ut_dir/ut_file parameters):

Code: Select all

Argument: Z:\Downloads
This is a log for utorrent usage (no file arguments):

Code: Select all

Parameter: ut_dir = /path/to/newly/finished/download/pass/in/by/utorrent

This is also the perfect time to explain why I updated the script to stop what you have been doing till now. You realize you process all of Z:\Downloads each and everytime you call filebot?? And if you're doing --action copy you'll be processing everything over and over for no reason, wasting TMDb/TheTVDB and other free services. Don't do that.

Re: Automated Media Center

Posted: 03 Jul 2013, 14:54
by andrewtdop
Thank you. Yes, that is clearer. I will try that. I didn't see that level of uTorrent specificity in the manual. That does help. Yes, I threw the Z:\Downloads in there to get it working and it did. I'll change it now that I understand better. Thank you for the help (and for creating such a neat and effective program.) Much appreciated.

Re: How about sharing our format expressions?

Posted: 09 Jul 2013, 16:46
by Rhavenom
My movie format expression:

Code: Select all

{genres[0]}/{n.acronym().getAt(0)}/{"$collection/"}/{n} [{y}]{"CD$pi"}{' '+file.path.match(/UNRATED|REMASTERED|EXTENDED|THEATRICAL|UNCUT|DIRECTORS CUT|THEATRICAL EDITION|THEATRICAL CUT/)}/{n.replaceTrailingBrackets()} [{try{"$source"}catch(e){'BluRay'}} m-{"$vf"} {" $vc"} {" $ac"} {media.AudioLanguageList} {" $af"}][{y}]{" CD$pi"}{fn.match(/[.]fanart|[.]mkv/)}{"."+lang.getDisplayName(Locale.getDefault()).lower()}
EX: /Action/A/Avatar Collection/Avatar [BluRay m-1080p x264 AC3 Spanish English 6ch][2009].mkv

Is it possible to display to rename all audio channels is the movie as well as the language of each of them?

EX: Avatar [BluRay m-1080p x264 Dual DTS Esp AC3 Eng 6ch][2009].mkv ??

Re: Automated Media Center

Posted: 09 Jul 2013, 19:27
by Chryses
Hi, tnx for this, this's very usefull!!!

I've 2 question:

1. I tried many way but with no lucky, it's possible to have always a "0" on the series name? I mean Dexter - 08x01 and not Dexter - 8x01
2. Some time the movie is 1 cd some time not :) Ther's a way to tell the script that if the movie is on 1 single file to make the movie name without the cd at the end? I actually use this method to rename te movie "movieFormat=Film/{n} ({y}){\" Cd$pi\"}"

J

Re: Automated Media Center

Posted: 10 Jul 2013, 04:13
by rednoah
1. Very easy:

Code: Select all

{s.pad(2)}x{e.pad(2)}
1.1. A bit more complicated if you take multi-episode files into consideration as well:

Code: Select all

{s.pad(2)}x{es.collect{ it.pad(2) }.join('-')}
2. If there's only one movie file, {pi} will be undefined and unwind the whole {...} block. That's the difference between {" CD$pi"} and CD{pi} and if you use my examples it covers all these common cases.

Re: Automated Media Center

Posted: 10 Jul 2013, 12:03
by zicoz
If I don't want it to rename movies, do I just add --def movies=n ?

Re: Automated Media Center

Posted: 10 Jul 2013, 12:38
by rednoah
Nope, with the AMC script you can't not rename movies. Unless you modify the script yourself.

Re: Automated Media Center

Posted: 10 Jul 2013, 20:57
by Chryses
rednoah wrote:1. Very easy:

Code: Select all

{s.pad(2)}x{e.pad(2)}
1.1. A bit more complicated if you take multi-episode files into consideration as well:

Code: Select all

{s.pad(2)}x{es.collect{ it.pad(2) }.join('-')}
2. If there's only one movie file, {pi} will be undefined and unwind the whole {...} block. That's the difference between {" CD$pi"} and CD{pi} and if you use my examples it covers all these common cases.
Tnx, the series format works like a charm!

But for the movie I can't figure out how to make it works, I can't find your examples. It's on this 3d?

J

Re: Automated Media Center

Posted: 11 Jul 2013, 03:09
by rednoah
I don't know the issue with your movie format. What you seem to describe can't happen.

Maybe you mean this?
http://www.filebot.net/forums/viewtopic.php?f=5&t=806

Re: Automated Media Center

Posted: 11 Jul 2013, 15:46
by Chryses
I never see that 3d :)

Btw, this's my actual movieformat

Film/{n} ({y}){\" Cd$pi\"}

So, I've one directory for all my movies.

My goal is, let assume that I've the film RED

So if I've one single file the name must be RED.avi
Else if I've 2 or more files the name must be RED - CD1.avi RED - CD2.avi ...

But I can't figure out how to do that :)

Re: Automated Media Center

Posted: 11 Jul 2013, 16:25
by rednoah
1. What 3D? The default format has no special handling for 3D movies.

2. Work perfectly:

Code: Select all

...
Parameter: movieFormat = Film/{n} ({y}){" Cd$pi"}
Input: D:\testdata\AMC-TEST\Green Snake.mp4
Input: D:\testdata\AMC-TEST\Red Cliff A.mp4
Input: D:\testdata\AMC-TEST\Red Cliff B.mp4
Green Snake.mp4 [series: null, movie: Green Snake (1993)]
Red Cliff A.mp4 [series: null, movie: Red Cliff (2008)]
Red Cliff B.mp4 [series: null, movie: Red Cliff (2008)]
Group: [tvs:null, mov:Green Snake (1993), anime:null] => [Green Snake.mp4]
Group: [tvs:null, mov:Red Cliff (2008), anime:null] => [Red Cliff A.mp4, Red Cliff B.mp4]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [D:\testdata\AMC-TEST\Green Snake.mp4]
[COPY] Rename [D:\testdata\AMC-TEST\Green Snake.mp4] to [D:\output\Film\Green Snake (1993).mp4]
Processed 1 files
Rename movies using [TheMovieDB]
Auto-detect movie from context: [D:\testdata\AMC-TEST\Red Cliff A.mp4]
Auto-detect movie from context: [D:\testdata\AMC-TEST\Red Cliff B.mp4]
[COPY] Rename [D:\testdata\AMC-TEST\Red Cliff A.mp4] to [D:\output\Film\Red Cliff (2008) Cd1.mp4]
[COPY] Rename [D:\testdata\AMC-TEST\Red Cliff B.mp4] to [D:\output\Film\Red Cliff (2008) Cd2.mp4]
...
Did you read and understand http://www.filebot.net/forums/viewtopic.php?f=5&t=806 where it says all movie parts must be in the same input set?

Re: Automated Media Center

Posted: 11 Jul 2013, 16:43
by Chryses
3d was refered to the post :D

I think that the problem is the double quotes, you said that must be escaped with \

so my movieformat is
movieFormat=Film/{n} ({y}){\" Cd$pi\"}

and the log is

Code: Select all

Parameter: seriesFormat = Serie Tv/{n}/{n} - {s.pad(2)}x{es.collect{ it.pad(2) }.join('-')} - {t}
Parameter: movieFormat = Film/{n} ({y}){" Cd"}
Argument: /home/jorman/Scrivania/da
Input: /home/jorman/Scrivania/da/red.avi
red.avi [series: Hong Ling Jin Xia, movie: Red (2010)]
Exclude Series: Hong Ling Jin Xia
Group: [tvs:null, mov:Red (2010), anime:null] => [red.avi]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/home/jorman/Scrivania/da/red.avi]
[MOVE] Rename [/home/jorman/Scrivania/da/red.avi] to [/home/jorman/Scrivania/a/Film/Red (2010) Cd.avi]
This's my full string, maybe I made another error :)

Code: Select all

filebot -script fn:amc "$check_dir/" --output "$dest_dir" --action move --conflict override -non-strict --def music=n --log-file amc.log --def artwork=n --def "seriesFormat=Serie Tv/{n}/{n} - {s.pad(2)}x{es.collect{ it.pad(2) }.join('-')} - {t}" "movieFormat=Film/{n} ({y}){\" Cd$pi\"}" --lang it

Re: Automated Media Center

Posted: 11 Jul 2013, 17:05
by rednoah
This is what gets passed into to FileBot:

Code: Select all

Parameter: movieFormat = Film/{n} ({y}){" Cd"}
Your shell is messing with the $name variables. You'll probably need to escape the \$ as well as the \"

Re: Automated Media Center

Posted: 12 Jul 2013, 13:42
by Xen
Is the line the same for qBittorrent on Windows as uTorrrent?

Re: Automated Media Center

Posted: 12 Jul 2013, 16:12
by rednoah
Probably not. You'll have to check the qBittorrent docs on how to call external programs on download complete.

Re: Automated Media Center

Posted: 12 Jul 2013, 16:20
by Xen
Maybe, I should use Deluge for windows then. I see instructions for Linux, Mac what about the windows version?

Looks like need to set it to run a .bat file

Re: Automated Media Center

Posted: 12 Jul 2013, 16:26
by rednoah
For that you'd have to port (rewrite) the Linux bash script to a Windows CMD bat script.

Re: Automated Media Center

Posted: 20 Jul 2013, 17:05
by zipmaster
Hey guys I'm having a little problem that I can't wrap my mind around. I'm automatizing the file renaming with Transmission, this is the script I am using:

Code: Select all

#!/bin/bash

filebot -script fn:amc --output "/media/" --log-file amc.log --action copy --conflict override -non-strict --def clean=y artwork=y "seriesFormat=HDD1/TV/{n}/{'S'+s}/{fn}" "movieFormat=HDD2/{n} ({y})/{n} ({y})" "musicFormat=HDD1/Music/{n}/{fn}" "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"
Which unfortunately isn't doing anything for me. The log reads as such:

Code: Select all

Parameter: clean = y
Parameter: artwork = y
Parameter: seriesFormat = HDD1/TV/{n}/{'S'+s}/{fn}
Parameter: movieFormat = HDD2/{n} ({y})/{n} ({y})
Parameter: musicFormat = HDD1/Music/{n}/{fn}
Parameter: ut_dir = /media/HDD2/DOWNLOADS/INCOMPLETE/The Gruffalo 2009 DVDRip
Parameter: ut_kind = multi
Parameter: ut_title = The Gruffalo 2009 DVDRip
Done ヾ(@⌒ー⌒@)ノ
Which is the standard output whenever filebot simply cannot find the file in question. Playing around by operating the script manually, I realized I can get filebot to work if I pass the proper file extension to ut_title i.e. "Parameter: ut_title = The Gruffalo 2009 DVDRip.mp4".

My problem is that ut_title is populated by the variable $TR_TORRENT_NAME which is passed by transmission WITHOUT file extension. Is there any way around this?

I've tried looking for clues in https://trac.transmissionbt.com/wiki/Scripts but it would seem that there's no variable assigned by Transmission with the file extension type. I thought of modifying the script by searching for the file extension type first using something like

Code: Select all

echo "The Gruffalo 2009 DVDRip."* |awk -F . '{print $NF}'
but I feel that would get complicated too quickly if there are other files witht he same name in the folder (ex: "The Gruffalo 2009 DVDRip.nfo"). Any ideas?

Re: Automated Media Center

Posted: 20 Jul 2013, 17:56
by rednoah
ut_title is completely ignored when looking up input files and is completely optional. It's used as email title for notifications and nothing else.


When I look at the log output it seems like FileBot can't find any files in the folder that is passed in:

Code: Select all

/media/HDD2/DOWNLOADS/INCOMPLETE/The Gruffalo 2009 DVDRip
ut_dir should be a folder, but if it's a path to a single video file amc will work with that as well.


For multi torrent files this should be the folder path. And for single files the exact path to the file.

Code: Select all

$TR_TORRENT_DIR/$TR_TORRENT_NAME
If $TR_TORRENT_NAME doesn't give you the filename for single torrent files then I don't know neither. I guess at this point we need transmission-remote and the torrent hash to grab all the info. Not just that useless stuff that is passed in via the environment.

Re: Automated Media Center

Posted: 23 Jul 2013, 04:07
by Chryses
rednoah wrote:This is what gets passed into to FileBot:

Code: Select all

Parameter: movieFormat = Film/{n} ({y}){" Cd"}
Your shell is messing with the $name variables. You'll probably need to escape the \$ as well as the \"
Tnx I'll try :D

Re: How about sharing our format expressions?

Posted: 31 Jul 2013, 16:30
by istvanszucs
Hi all,

I want to do something very simple. I want filebot to download subtitles in Hungarian for all movies in the current directory, and name it the same as the file name of the movie. My problem is that by default it seems to add the three letter language identifier to the file name. How can I prevent this. I need an exact match to the file name.

Thanks,
Istvan

Re: How about sharing our format expressions?

Posted: 31 Jul 2013, 19:43
by rednoah
0. Download subtitles
1. Go to Rename panel
2. Drop subtitle files into the left list
3. Drop video files into the right list
4. Hit Rename!

PS: Completely wrong thread...

Re: How about sharing our format expressions?

Posted: 31 Jul 2013, 20:47
by istvanszucs
rednoah wrote:0. Download subtitles
1. Go to Rename panel
2. Drop subtitle files into the left list
3. Drop video files into the right list
4. Hit Rename!

PS: Completely wrong thread...
I have a command line interface.

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 01 Aug 2013, 04:21
by rednoah
At this point it's most basic batch renaming. Any tool will do.

Here's a filebot script for that:
http://www.filebot.net/forums/viewtopic ... &t=5#p2100

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 01 Aug 2013, 08:31
by istvanszucs
rednoah wrote:At this point it's most basic batch renaming. Any tool will do.

Here's a filebot script for that:
http://www.filebot.net/forums/viewtopic ... &t=5#p2100
So I have to get it and rename it. I can't get it with the right name straight off.

Re: Automated Media Center

Posted: 08 Aug 2013, 13:21
by Chryses
Chryses wrote:
rednoah wrote:This is what gets passed into to FileBot:

Code: Select all

Parameter: movieFormat = Film/{n} ({y}){" Cd"}
Your shell is messing with the $name variables. You'll probably need to escape the \$ as well as the \"
Tnx I'll try :D
I found a little problem with "this settings", and I don't know how to resolve it :?

I've a script that launch filebot every time a movie file is created, but when I download a multi cd, the script make mistake!

Code: Select all

Parameter: movieFormat = Film/{n} ({y}){" Cd$pi"}

Code: Select all

Input: /media/TwoTera/Download/vari/red cd1.avi
red cd1.avi [series: Hong Ling Jin Xia, movie: Red (2010)]
Exclude Series: Hong Ling Jin Xia
Group: [tvs:null, mov:Red (2010), anime:null] => [red cd1.avi]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/media/TwoTera/Download/vari/red cd1.avi]
[MOVE] Rename [/media/TwoTera/Download/vari/red cd1.avi] to [/media/TwoTera/Multimedia/Film/Red (2010).avi]
In this example, I download first the 1st cd and then the 2nd, but filebot, when will finish, the script will overwrite the file.

Any chance that if, at the end of the filename it found cd1 etc etc, keep this information?

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 08 Aug 2013, 13:38
by rednoah
If you don't know how bash works and that $ specifies variables i recommend writing your format in way that doesn't need $

Like this:

Code: Select all

{' CD'+pi}

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 08 Aug 2013, 14:10
by Chryses
You're right, I mean, I can say that is a kind of miracle that all works!

Btw, not working :?

Code: Select all

Parameter: movieFormat = Film/{n} ({y}){' CD'+pi}

Code: Select all

[MOVE] Rename [/media/TwoTera/Download/vari/red cd1.avi] to [/media/TwoTera/Multimedia/Film/Red (2010).avi]
J

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 08 Aug 2013, 15:27
by rednoah
If you want {pi} to work you need to pass in both movie part files or the folder, not just -rename part1.avi

@see http://www.filebot.net/forums/viewtopic ... =806#p5169

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 08 Aug 2013, 17:39
by Chryses
ok, tnx for the info.

Do you have any ideas to do that?

I mean imagine this scenario:

one cron job configured to launch filebot and watch one directory. So ther's a possibility that a file is composed of several parts, so cd1 is available before cd2. If, in this period of time, the script parse the folder, the "problem" is created.

Any genial idea?

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 09 Aug 2013, 04:30
by rednoah
Yep, there is no solution for this case, esp if you're set on doing cron jobs. Best is to have the download app hand things over to filebot after all related files have been completed.

You can do the Parse CD<i> from filename via fn.match() approach and hope that the multi-part movies are well-named with CD1 CD2 etc

Both solutions have pros/cons as described in the page above.

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 09 Aug 2013, 08:50
by Chryses
So, something like this

Code: Select all

movieFormat=Film/{n} ({y}){' - '+fn.match(/(?i)cd+[0-9]/).toUpperCase()}{fn.match(/(?i)part +[0-9]of[0-9]/).toLowerCase()}
Any advice or ideas?

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 09 Aug 2013, 12:09
by rednoah
Look how I'd test that:

Code: Select all

{'Avatar Part 1of2'.match(/part\s*[0-9]of[0-9]/)}
You can prototype all of that quickly in the GUI.

In the end I'd come up with something like this. Convert Part 1of2 to CD1

Code: Select all

{'CD'+fn.match(/part\s*(\d)of(\d)/)}

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 09 Aug 2013, 13:15
by Chryses
Ok, tnx, I'll try some combinations :)

Re: How about sharing our format expressions?

Posted: 01 Sep 2013, 02:10
by ashfallen0
I'm not the greatest at REGEX, so I've had to more or less slave over my expressions(and to make them CLI/XBMC/Anidb/TVDB friendly :roll: )

Here's my current TV expression:

Code: Select all

/home/user/tv/{n.replace(':',' -').replaceAll(/[?]/, '')}/{n.replace(':',' -').replaceAll(/[?]/, '')} - {episode.special ? 'S00E'+special.pad(2) : s00e00} - {t.replace(':',' -').replaceAll(/[?]/, '')} {[hpi]}{'['+resolution} {' '+vc}{'-'+ac+']'}
Here's my current Anime expression:

Code: Select all

/home/user/anime/{(primaryTitle ?: n).replace(':',' -').replaceAll(/[?]/, '')}/{(primaryTitle ?: n).replace(':',' -').replaceAll(/[?]/, '')} - {episode.special ? "S"+special.pad(2) : absolute.pad(3)} - {t.replace(':',' -').replaceAll(/[?]/, '')} {[hpi]}{'['+resolution} {' '+vc}{'-'+ac+']'}

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

Posted: 03 Sep 2013, 08:11
by Faba
Hy,

I tried it but it always results in filenames like " , .mkv"

my format string looks like this

Code: Select all

"/mnt/samba/movies/{n} ({y})/{n.replaceFirst(/^(?i)(The|A)\s(.+)/, /$2, $1/).space('.')}.({y}).{vf}"
Any idea what I am doing wrong?

thanks

Faba

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

Posted: 03 Sep 2013, 08:24
by rednoah
The format looks good.

But I guess you didn't think of escaping the $-sign so bash is resolving $1 and $2 to empty strings and not passing in the literal value of "$1" or "$2".

I don't see a reason why {y} wouldn't have a value. With {vf} u may wanna make sure libmediainfo is working correctly.

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

Posted: 03 Sep 2013, 09:02
by Faba
sorry the {y} and {vf} work correctly

so the results is actually " , (2007).720p.mkv".

I escaped the $ sign and now i is working like expected

Thanks!

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 23 Sep 2013, 22:16
by SatNav
Hi, I'm having a bit of trouble getting the amc script to work. It's been working fine for a few months, and just started playing up the last couple of days. I have a script called from transmission. It is as follows:

Code: Select all

filebot -script fn:amc --output "/media/WD1TB/Videos" --action copy --conflict override -non-strict --def artwork=n "seriesFormat=TV/{n}/Season {s.pad(2)}/{s00e00} - {t}" "movieFormat=Movies/{n} ({y}) {vf} {af}" "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME" &> /etc/transmission-daemon/log
But recently it has failed with this in the log:

Code: Select all

Parameter: artwork = n
Parameter: seriesFormat = TV/{n}/Season {s.pad(2)}/{s00e00} - {t}
Parameter: movieFormat = Movies/{n} ({y}) {vf} {af}
Parameter: ut_dir = /mnt/Downloads/My.Favourite.Linux.ISO.S01E01.PREAIR.DVDRip.XviD-CRX.avi
Parameter: ut_kind = multi
Parameter: ut_title = My.Favourite.Linux.ISO.S01E01.PREAIR.DVDRip.XviD-CRX.avi
Exception: Conflicting arguments: pass in either file arguments or ut_dir/ut_file parameters but not both
Failure (°_°)
I'm not sure why it's just started failing in this way. The only recent change is that I moved the location of my downloads folder from '/home/mark/Downloads' to '/mnt/Downloads', but I don't see how that could make a difference.

In any case, to my mind, the error message doesn't seem to be describing what's going wrong. Any ideas?

Re: [CODE] Examples and Snippets

Posted: 04 Oct 2013, 19:16
by nitewulf
Can these be incorporated as filebot arguments from the command line? I'm trying to integrate the script to override series auto-detect into my utorrent post processing.

Re: [CODE] Examples and Snippets

Posted: 05 Oct 2013, 10:32
by rednoah
That doesn't make sense. You can incorporate things your own way by putting together your own script. In your own script you can of course script whatever you want.

Re: [DOCS] Exclude Blacklist & Series-Mappings

Posted: 29 Oct 2013, 05:52
by rednoah
Added entries to exclude-blacklist:

Code: Select all

Deleted.and.Extended.Scenes
Deleted.Scenes

Re: [DOCS] Exclude Blacklist & Series-Mappings

Posted: 24 Nov 2013, 18:42
by Twain32
Hi. How are those lists working ? Do we need to download them manually or is there an auto updating system included in the Filebot main application ?

I am trying to rename a "Law & Order SVU" episode (with the CLI), but Filebot ends up using the "Law & Order" episode info.

Re: [DOCS] Exclude Blacklist & Series-Mappings

Posted: 24 Nov 2013, 19:09
by rednoah
It's all auto-updated.

But since Law & Order SVU since it does get the series options the lists here won't help. Check into --q and --filter cmdline options.

Re: Exclude Blacklist & Series-Mappings

Posted: 20 Dec 2013, 07:36
by rednoah
Added exclude rules for Anime OP/EDs:

Code: Select all

(?<=\b|_)(NCED|NCOP|(OP|ED)\p{Digit}\p{Alpha})(?=\b|_])

Re: Thank You So Very Much & Happy Holidays

Posted: 30 Dec 2013, 18:09
by Ambroisie
I would like to know the way to make it find the release groups. Could you pm it to me... ?

Re: Thank You So Very Much & Happy Holidays

Posted: 01 Jan 2014, 05:08
by Ithiel
Hi Ambroisie, the code for release groups is {group}

More info can be found here: http://www.filebot.net/forums/viewtopic ... ilit=group

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Posted: 03 Jan 2014, 07:48
by Ithiel
I donated 10 euro, and once upgraded to a VIP (the account upgrade is manually verified by them so it takes a few hours), I was able to download about 4000+ subtitles in a few hours before I hit the limit.

Figured it was probably worth the limit just so that I had the extra quota to play around with when testing this http://www.filebot.net/forums/viewtopic.php?f=3&t=1222

Their forums say non vip is limited to 200, but you're right - it's all over the place.

Not Logged In: Smallest Quota (seemed to be closer to 100, also seems to be more drop out prone)
Logged In As Free User: Moderate Quota (more reliable, but still iffy quota of about 200-300 depending on what you requested)
High Quota: VIP User @ 10 Euro / Year (large enough quota that it shouldn't ever really be an issue)

Edit: Just checked, and it was actually over 5000 subtitles I downloaded in the short window after upgrading to VIP >.<

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Posted: 03 Jan 2014, 07:57
by rednoah
This should list your download limits:

Code: Select all

filebot -script osdb.stats

Re: Exclude Blacklist & Series-Mappings

Posted: 03 Jan 2014, 12:31
by Ambroisie
You should add TBBT for The Big Bang theory

Re: Exclude Blacklist & Series-Mappings

Posted: 03 Jan 2014, 14:22
by rednoah
Added.

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Posted: 08 Jan 2014, 03:44
by Akki
Can you add "www.Torrenting.com" to the blacklist? It's in the folder name and for some reason always matches Christopher Hitchens.... Would be nice if there was an easy way to have a local blacklist, or at least have the script ignore the folder name for matching and always use the filename. Strict matching doesn't really work for my purposes, unfortunately...

Edit: Just realized that there's already a filter in the blacklist that should ignore this, but that doesn't seem to be working. I can't tell why, but removing that part from the folder name always works...

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Posted: 08 Jan 2014, 05:50
by rednoah
This will catch it:

Code: Select all

www[.][\w-.]+[.](com|net|tk|ro|cd|me|de)
Give me the whole path and I'll have a look which token is messing with it.

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Posted: 08 Jan 2014, 07:02
by Akki
rednoah wrote:This will catch it:

Code: Select all

www[.][\w-.]+[.](com|net|tk|ro|cd|me|de)
Give me the whole path and I'll have a look which token is messing with it.
Yeah, I saw that after I posted. Really weird. Here is every instance I can find from the last week or so. In some cases it matches correctly, sometimes not:

Code: Select all

Rename episodes using [TheTVDB]
Auto-detected query: [www, Top Chef, www Torrenting com Top Chef]
Fetching episode data for [Christopher Hitchens]
Fetching episode data for [Top Chef]
Fetching episode data for [Top Chef Suomi]
Fetching episode data for [Top Chef Canada]
Fetching episode data for [Top Chef France]
Fetching episode data for [Top Chef España]
[MOVE] Rename [C:\Users\User\Downloads\TV\www.Torrenting.com - Top.Chef.S11E12.HDTV.x264-PLAYNOW\Top.Chef.S11E12.HDTV.x264-PLAYNOW.mp4] to [C:\Users\User\TV\Top Chef\Season 11\Top Chef - 11x12 - Mississippi Mud Bugs.mp4]

Code: Select all

Rename episodes using [TheTVDB]
Auto-detected query: [www]
Fetching episode data for [Christopher Hitchens]
Stripping invalid characters from new path: C:/Users/User/TV/Christopher Hitchens/Season 0/Christopher Hitchens - 0x02 - Debate: Frank Turek
[MOVE] Rename [C:\Users\User\Downloads\TV\www.Torrenting.com - Saturday.Night.Live.S39.Special.Best.of.this.Season.HDTV.x264-2HD\saturday.night.live.s39.special.best.of.this.season.hdtv.x264-2hd.mp4] to [C:\Users\User\TV\Christopher Hitchens\Season 0\Christopher Hitchens - 0x02 - Debate Frank Turek.mp4]

Code: Select all

Rename episodes using [TheTVDB]
Auto-detected query: [www, www Torrenting com Pretty Little Liars]
Fetching episode data for [Christopher Hitchens]
Stripping invalid characters from new path: C:/Users/User/TV/Christopher Hitchens/Season 0/Christopher Hitchens - 0x05 - Debate: The Three New Commandments
[MOVE] Rename [C:\Users\User\Downloads\TV\www.Torrenting.com - Pretty.Little.Liars.S04E14.HDTV.x264-LOL\pretty.little.liars.414.hdtv-lol.mp4] to [C:\Users\User\TV\Christopher Hitchens\Season 0\Christopher Hitchens - 0x05 - Debate The Three New Commandments.mp4]

Code: Select all

Rename episodes using [TheTVDB]
Auto-detected query: [www, brooklyn nine nine, www Torrenting com Brooklyn Nine Nine]
Fetching episode data for [Christopher Hitchens]
Fetching episode data for [Brooklyn Nine-Nine]
[MOVE] Rename [C:\Users\User\Downloads\TV\www.Torrenting.com - Brooklyn.Nine.Nine.S01E12.HDTV.x264-2HD\brooklyn.nine.nine.s01e12.hdtv.x264-2hd.mp4] to [C:\Users\User\TV\Brooklyn Nine-Nine\Season 1\Brooklyn Nine-Nine - 1x12 - Pontiac Bandit.mp4]

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Posted: 08 Jan 2014, 07:43
by rednoah
Haha, this one is really bad luck! :D

There's an anime names:[つまつま 人妻×人妻, WWW, Wife with Wife] which allows WWW to be part of the query, and it gets matched to names:[Christopher Hitchens, www.raydragon.com Presents...] :D Maybe shitty data in the IMDb when that one was scraped.


Try one of the latest revisions though. It works just fine despite those misleading query options.

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Posted: 08 Jan 2014, 15:26
by Ithiel
*"Wife with Wife?", Ithiel thought to himself, "That's odd, I've never heard of that anime before... wonder what that's about?"*
*types it into Google*

... um, so.. yeah, in retrospect, that's exactly the kind of anime you'd expect a show called 'Wife with Wife' to be.

FYI: A josei anime it is not - NSFW :-/

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Posted: 08 Jan 2014, 17:46
by rednoah
hahaha, never bothered to actually look it up Wife with Wife - Absolutely Not For Children :lol:

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Posted: 08 Jan 2014, 19:27
by Akki
rednoah wrote:Haha, this one is really bad luck! :D

There's an anime names:[つまつま 人妻×人妻, WWW, Wife with Wife] which allows WWW to be part of the query, and it gets matched to names:[Christopher Hitchens, www.raydragon.com Presents...] :D Maybe shitty data in the IMDb when that one was scraped.


Try one of the latest revisions though. It works just fine despite those misleading query options.
That's... really interesting. What do you mean by latest revisions, though?

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Posted: 08 Jan 2014, 21:18
by rednoah
FAQ -> Last Q

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Posted: 08 Jan 2014, 21:37
by Akki
rednoah wrote:FAQ -> Last Q
Ah, I see. Didn't realize you were talking about the jar as opposed to the whole package. Thanks!

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Posted: 09 Jan 2014, 05:54
by Ithiel
As rednoah is pretty much always making tweaks, fixes, or improvements (generally in response to forum requests), the jar file is normally updated every couple of days. If you ever notice a strange bug, the first thing to try is updating your jar to see if he's already fixed it, lol. :-)

If you're running Windows, you can download/run this script that will download and swap out the jar file for you automatically:
http://www.filebot.net/forums/viewtopic.php?f=4&t=1225

Re: Automated Media Center

Posted: 12 Jan 2014, 19:28
by tmThEMaN
First of all, Thanks a million man. This app rocks big time when using the scripts. I just witnessed magic happening here.

I want to use AMC script, but I also want to re-encode the downloaded subtitles to UTF8 (or other encoding). Is there a way to do it directly using AMC or i should modify it.

Thanks.

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 13 Jan 2014, 01:42
by rednoah
Why do you think it's not doing that already? Cause it is, by default, and you can't change that.

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 13 Jan 2014, 17:50
by tmThEMaN
I'm using Mac, some subtitles when downloaded are not being displayed on Plex, but XBMC can display them.

When i investigated this, I installed Aegisub and when i open some subtitle files it says "x-mac-cyrillic is not a supported character set". When i use open with "Open Subtitle with Charset" and choose "Windows 1256" Charset, the file works and then i can export it as .srt with the right Charset.

I was looking for a way to automate this part and re-encode all subtitles after downloading them. As you confirmed, currently AMC is rencoding to UTF-8, so i guess i want to re-encode to Windows-1256 instead.

Somehow, XBMC does not require that, i'm not sure why. I'm about to submit this issue to Plex as well in case they can add a fix.

Thanks,
TM

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 14 Jan 2014, 00:04
by rednoah
You'd have to modify the script to re-encode into Windows-1256, probably easier to just do a post processing script that turns UTF-8 into Win-1256, though any text file really should be in UTF-8, that would safe the world a lot of trouble.

Re: [CODE] Examples and Snippets

Posted: 16 Jan 2014, 14:16
by Ithiel
Here's an example of running two commands in a single command line:

Code: Select all

cmd /c filebot -get-subtitles "%1" -non-strict --lang en --log-file context.log && filebot -get-subtitles "%1" -non-strict --lang da --log-file context.log
The above example is for a context menu option to download subtitles in two languages at once. If you want to string multiple commands together on a single line, simply use &&

You can also read more about using multiple commands and conditional processing symbols in the official Microsoft documentation.

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Posted: 20 Feb 2014, 01:51
by neriox
I try this command:

Code: Select all

>filebot -script fn:osdb.login
and I got this >>

Code: Select all

>Enter OpenSubtitles username: XX
Enter OpenSubtitles password: XX
Testing OpenSubtitles... OK
Done ?(?????)?
But when I try this>

Code: Select all

>filebot -script osdb.stats
I got this >>

Code: Select all

FileNotFoundException: osdb.stats
java.io.FileNotFoundException: osdb.stats
        at net.sourceforge.filebot.cli.ArgumentProcessor$DefaultScriptProvider.g
etScriptLocation(ArgumentProcessor.java:195)
        at net.sourceforge.filebot.cli.ArgumentProcessor.process(ArgumentProcess
or.java:106)
        at net.sourceforge.filebot.Main.main(Main.java:192)
Failure (░_░)
Launch4j: Failed to run the given command.
O sistema nπo pode encontrar o arquivo especificado.
What can be happened?

Re: [MANUAL] Configure OpenSubtitles and Sublight login

Posted: 20 Feb 2014, 04:32
by rednoah
For that one you need to use the latest build, the 3.8 release is too old.

Re: [SNIPPET] Sort into A-Z folders

Posted: 26 Feb 2014, 06:37
by Zerelah
Can this be changed to work with ABCD folder instead so movies beginning with a-d goes in ABCD ?
I have tried to modify this with sort to drives but with no success :(
I currently have The one with sort to drives set up but if I ever need to change paths I have to change them alll here it is just one.
Hope you understand what i mean

Re: Looking for testers on Synology NAS

Posted: 13 Mar 2014, 08:21
by Nordh
rednoah wrote: * What do you think it should like like?
* What use-cases do you have? What workflow do you think would make sense?
* What features should be supported?
Still failing to get FileBot to run on my ReadyNAS, I'm not 100% sure of all its features. When I first came to this site I was looking for a program that did a few things that I've now had to resort to several different programs to work out. I'll go through my workflow:

1a Movies downloads via Couchpotato
1b Movies are unrared and sorted via Couchpotato
(It's a good setup that doesn't need fixing.)

2a TV shows are downloaded via FlexGet
2b TV shows are unrared and moved to a "finished folder" once every day via pyexpand, this will unrar all folders in my download folder, no matter if it's been done on a previous day or not. TV shows that aren't rar:ed will fail to go to the next step because of a lack of copy-support in pyexpand, and I've found no other scripts that can do both.
2c Sickbeard renames and sorts the files in the finished folder.

Both FlexGet and Couchpotato uses Transmission for the downloads, and puts the downloads in seperate folders to make sure their scripts don't interfere with each other.

So as you can see, my step 2b really needs refinement, and that's what I hope can be found with FileBot, and since I don't use Sickbeard for its webui database of TV shows, only for its renamer, it would replace step 2c as well.

Unless you will be working on my 1a and 2a steps, those are the basic needs I have.

Re: Exclude Blacklist & Series-Mappings

Posted: 17 Mar 2014, 11:33
by igcr
Can you add 'TWD' for The Walking Dead?

Re: Exclude Blacklist & Series-Mappings

Posted: 17 Mar 2014, 18:23
by rednoah
Added.

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

Posted: 03 Apr 2014, 06:24
by JFMillerUSA
trying to make a batch file for uTorrent and my movie IF doesn't seem to work but the Television does any ideas

Code: Select all

IF %1==11 (
	IF /I %2==Television ("C:\Program Files\FileBot\filebot.exe" -rename %3 --db thetvdb --action move --conflict override -non-strict --output C:\Users\Jeremy\Videos\Television --format {n}\{n}.{s00e00}.{t}) 
	IF /I %2==OldMovie ("C:\Program Files\FileBot\filebot.exe" -rename %3 --db imdb --action move --conflict override -non-strict --output "C:\Users\Jeremy\Videos\Old Movies" --format {n.replaceFirst^(/^^(?i^)^(The^)\s^(.+^)/, /$2, $1/^)[0]}\{n} ^({y}^){" CD$pi"})
	PAUSE
)
PAUSE
%1 is Status
%2 is Label
%3 is Directory of torrent

Re: Add Blacklisted Terms and Improve Movie / Series Detecti

Posted: 03 Apr 2014, 15:11
by jsmitty
rednoah, can you please add ddlvalley.net to the blacklist? it matches everything to the tv show 'the net'

thanks in advance

Re: Fetch all subtitles

Posted: 06 Apr 2014, 12:08
by Hematot
rednoah wrote: Fetch subtitles for all folders:

Code: Select all

filebot -script fn:suball /path/to/media
Options:
--def maxAgeDays=7 set a max-age for files that will be processed, older files will be ignored
View Script:
https://github.com/filebot/scripts/blob ... all.groovy

Hi rednoah,
this script isn't working for me...
For some reason it thinks all the .mkv files I've tried it with already have subs, even the ones that neither MediaInfo, openelec or VLC can find any for.
I won't try to speculate why since I have no idea how getMediaInfo(file:f, format:'''{media.TextCodecList}''').isEmpty() works...
I've also tried to edit and run the script locally in order to rule out that it is the maxAgeDays part that is excluding the subs to be downloaded. Same result, see below.
Tried to find documentation on getMediaInfo and its parameters but with no luck.

Local code:

Code: Select all

// filebot -script fn:suball <options> <folder>

def lastModifiedLimit = tryQuietly{ System.currentTimeMillis() - (maxAgeDays.toLong() * 24 * 60 * 60 * 1000) }

def young = { f ->
	// ignore files that are too old
	if (lastModifiedLimit != null && f.lastModified() < lastModifiedLimit)
		return false
		
	return true
}

def unsubbed = { f ->
	// ignore files that already have subtitles
	if (getMediaInfo(file:f, format:'''{media.TextCodecList}''').isEmpty())
		return false
	
	return true
}

/*
 * Get subtitles for all your media files  
 */
args.eachMediaFolder {
	def videos = it.listFiles{ it.isVideo() }	
	// ignore videos that are too old or already have embedded subtitles
	videos = videos.findAll{ 
		if (!young(it)) {
			_log.finest "Too OLD: " + it.getName()
			return false
		}
		if (!unsubbed(it)) {
			_log.finest "Already SUBBED: " + it.getName()
			return false
		}
		return true
	}	
	getMissingSubtitles(file:videos)
}

Code: Select all

C:\Program Files\FileBot>filebot -script "C:\Program Files\FileBot\suball.groovy
" "T:\TVserier\Xxxx\Season 01"
Already SUBBED: Xxxx - 1x01 - Pilot.mkv
Already SUBBED: Xxxx - 1x02 - Title02.mkv
...
Already SUBBED: Xxxx - 1x13 - Title13.mkv
No missing subtitles
Done ?(?????)?

C:\Program Files\FileBot>pause
Press any key to continue . . .
Cheerio
/Hematot

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 06 Apr 2014, 14:32
by rednoah
Looks like the condition was the wrong way around. Should be fixed now.

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 06 Apr 2014, 14:46
by Hematot
But then it thinks that none of the .mkv files I've tried it with have subs...
I wasn't clear on the fact that some, but only some, of the .mkv's are missing embedded subs.

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 06 Apr 2014, 15:13
by rednoah
Make sure to use the latest script. Works fine now:

Code: Select all

C:\testdata>filebot -script fn:suball .
Exclude: C:\testdata\evangelion 1.11 480p dual audio w-soft subs.mkv
Exclude: C:\testdata\Lawrence of Arabia (1962).mkv
Get [English] subtitles for 1 files
Looking up subtitles by filehash via OpenSubtitles
Matched [Revolution - S02E18 - Austin City Limits.mkv] to [Revolution.2012.S02E18.HDTV.x264-LOL] via filehash
Fetching [Revolution.2012.S02E18.HDTV.x264-LOL.srt]
Writing [Revolution.2012.S02E18.HDTV.x264-LOL.srt] to [Revolution - S02E18 - Austin City Limits.eng.srt]
The first two have embedded subtitles, thus get ignored. That last episode doesn't have a subtitle track, so it'll fetch subtitles.

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 06 Apr 2014, 20:18
by Hematot
Well, for me the files with no embedded subtitles still gets identified as having them.
Running the script via fn:suball which I believe always points to your current script?
If it's to any help, here's what MediaInfo reports for one of them:

Code: Select all

General
Unique ID                                : xxx (0xyyy)
Complete name                            : zzz
Format                                   : Matroska
Format version                           : Version 2
File size                                : 995 MiB
Duration                                 : 47mn 3s
Overall bit rate                         : 2 957 Kbps
Encoded date                             : UTC 2013-05-01 16:54:35
Writing application                      : mkvmerge v3.0.0 ('Hang up your Hang-Ups') built on Apr 19 2010 11:58:49
Writing library                          : libebml v0.7.7 + libmatroska v0.8.1

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : [email protected]
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 9 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 47mn 3s
Bit rate                                 : 2 450 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.111
Stream size                              : 825 MiB (83%)
Writing library                          : x264 core 130 r2273 b3065e6
Encoding settings                        : cabac=1 / ref=9 / deblock=1:1:1 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=14 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=5 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Default                                  : No
Forced                                   : No
Matrix coefficients                      : BT.709

Audio
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : A_AC3
Duration                                 : 47mn 3s
Bit rate mode                            : Constant
Bit rate                                 : 448 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 151 MiB (15%)
Default                                  : Yes
Forced                                   : No
For now I'll just use the getMissingSubtitles and switch to the embedded if need be!
Rock on! /Hematot

Re: POSTBUCKET - where random posts in unrelated topics go

Posted: 07 Apr 2014, 05:06
by rednoah
According to MediaInfo this file does not contain subtitles.

Have you tried checking from FileBot? Edit Format -> Variables (icon only) -> Select file and click table:
http://snag.gy/j3DwR.jpg

Also the fn:name always uses the latest, but only updates once a day, so you might wanna try doing -clear-cache once if I've updated the script less than a day before.