Running FileBot from the console, Groovy scripting, shell scripts, etc
Qyles
Posts: 14 Joined: 16 Jan 2013, 10:22
Post
by Qyles » 15 Nov 2013, 13:42
Hello,
Is there any way use the transmission script for movies titles in spanish and anime/tvshows in english?
My Actual script is the following:
Code: Select all
/Applications/Filebot.app/Contents/MacOS/filebot -script fn:amc --output "/Users/1/Volumes" --log-file amc.log --action move --conflict override -non-strict --def artwork=y --def subtitles=en --def xbmc=192.168.1.100 --def pushover=0430MRmbHcZ06uzUCJSoz7kZ1ZzUwJ "seriesFormat=timecapsule/TVshows/{n}/Season {s}/{n} ({y}) - {sxe} - {t}" “animeFormat=timecapsule/Anime/{n}/Season {s}/{n} ({y}) - {sxe} - {t}" "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME"
I would like to add a moviesFormat but using the titles in spanish.
Thank you very much!
rednoah
The Source
Posts: 23935 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 15 Nov 2013, 14:55
Easiest way would be to use a slightly modified version of the amc script and make movie rename work in Spanish and Anime / TV Shows rename in English.
e.g.
Qyles
Posts: 14 Joined: 16 Jan 2013, 10:22
Post
by Qyles » 17 Nov 2013, 19:55
Thank you!
Something like this?
Code: Select all
// MOVIE MODE
else if (group.mov && !group.tvs && !group.anime) {
def dest = rename(file:files, format:format.mov, db:'TheMovieDB', lang: 'es')
if (dest && artwork) {
dest.mapByFolder().each{ dir, fs ->
_log.finest "Fetching artwork for $dir from TheMovieDB"
def movieFile = fs.findAll{ it.isVideo() }.sort{ it.length() }.reverse().findResult{ it }
fetchMovieArtworkAndNfo(dir, detectMovie(movieFile), movieFile, backdrops)
}
}
if (dest == null && failOnError) {
throw new Exception("Failed to rename movie: $group.mov")
}
}
Then I modified the bash script to: /Applications/Filebot.app/Contents/MacOS/filebot -script /path/to/script
Is that it?? I'm going to try it
Thank you very much.
PS. Another little question. I was going to open a new thread because it isn't about but I ask here.
Naruto Shippudden is being classified as a TV Show, not a Anime. Is there anyway to change that?
rednoah
The Source
Posts: 23935 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 17 Nov 2013, 20:57
Everything is "TV Show" by default UNLESS:
Code: Select all
tryQuietly{ ut_label } =~ /^(?i:Anime)/ || (f.isVideo() && (f.name =~ "[\\(\\[]\\p{XDigit}{8}[\\]\\)]" || getMediaInfo(file:f, format:'''{media.AudioLanguageList} {media.TextCodecList}''').tokenize().containsAll(['Japanese', 'ASS'])))
Qyles
Posts: 14 Joined: 16 Jan 2013, 10:22
Post
by Qyles » 18 Nov 2013, 12:31
Thx,
I used this :
Code: Select all
/Applications/Filebot.app/Contents/MacOS/filebot -script /path/to/script/amc.groovy
And edited the amc.groovy archive with this:
Code: Select all
// MOVIE MODE
else if (group.mov && !group.tvs && !group.anime) {
def dest = rename(file:files, format:format.mov, db:'TheMovieDB', lang: 'es')
if (dest && artwork) {
dest.mapByFolder().each{ dir, fs ->
_log.finest "Fetching artwork for $dir from TheMovieDB"
def movieFile = fs.findAll{ it.isVideo() }.sort{ it.length() }.reverse().findResult{ it }
fetchMovieArtworkAndNfo(dir, detectMovie(movieFile), movieFile, backdrops)
}
}
if (dest == null && failOnError) {
throw new Exception("Failed to rename movie: $group.mov")
}
}
And it isn't working.
Any clue? Thank you.
PS. Also tried with script "/path/to/script/amc.groovy" and get the same result.
rednoah
The Source
Posts: 23935 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 18 Nov 2013, 13:29
Looks good to me. Just make a simple 1-line script with just rename and see if you can get that working first. Also if there is no Spanish titles it'll default to English, keep that in mind.
Qyles
Posts: 14 Joined: 16 Jan 2013, 10:22
Post
by Qyles » 04 May 2014, 18:38
Thank you for your answer and sorry for the late response.
I'm trying again with the personalised amc groovy I wrote in the previous posts and I get this error:
Code: Select all
Locking /Users/Guille/.filebot/logs/amc.log
Parameter: artwork = y
Parameter: subtitles = en
Parameter: seriesFormat = {n}/Season {s}/{n} ({y}) - {sxe} - {t}
Argument: /Users/Guille/Downloads/TORRENT/Series
Input: /Users/Guille/Downloads/TORRENT/Series/Da.Vincis.Demons.S02E07.HDTV.x264-2HD.mp4
FileNotFoundException: /Users/Guille/Documents/Scripts/lib/htpc.groovy (No such file or directory)
Group: [tvs:Da Vincis Demons] => [Da.Vincis.Demons.S02E07.HDTV.x264-2HD.mp4]
Get [English] subtitles for 1 files
Looking up subtitles by filehash via OpenSubtitles
Matched [Da.Vincis.Demons.S02E07.HDTV.x264-2HD.mp4] to [Da.Vincis.Demons.S02E07.HDTV.x264-2HD] via filehash
Fetching [Da.Vincis.Demons.S02E07.HDTV.x264-2HD.srt]
Export [Da.Vincis.Demons.S02E07.HDTV.x264-2HD.srt] as: SubRip / UTF-8
Writing [Da.Vincis.Demons.S02E07.HDTV.x264-2HD.srt] to [Da.Vincis.Demons.S02E07.HDTV.x264-2HD.eng.srt]
Rename episodes using [TheTVDB]
Auto-detected query: [Da Vincis Demons]
Fetching episode data for [Da Vinci's Demons]
Auto-detected query: [Da Vincis Demons]
Fetching episode data for [Da Vinci's Demons]
[MOVE] Rename [/Users/Guille/Downloads/TORRENT/Series/Da.Vincis.Demons.S02E07.HDTV.x264-2HD.eng.srt] to [/Users/Guille/Volumes/series/Da Vinci's Demons/Season 2/Da Vinci's Demons (2013) - 2x07 - The Vault of Heaven.srt]
[MOVE] Rename [/Users/Guille/Downloads/TORRENT/Series/Da.Vincis.Demons.S02E07.HDTV.x264-2HD.mp4] to [/Users/Guille/Volumes/series/Da Vinci's Demons/Season 2/Da Vinci's Demons (2013) - 2x07 - The Vault of Heaven.mp4]
Processed 2 files
May 4, 2014 8:35:51 PM net.sourceforge.filebot.media.MediaDetection storeMetaInfo
WARNING: java.lang.NoSuchMethodError: java.io.File.toPath()Ljava/nio/file/Path;
May 4, 2014 8:35:52 PM net.sourceforge.filebot.media.MediaDetection storeMetaInfo
WARNING: java.lang.NoSuchMethodError: java.io.File.toPath()Ljava/nio/file/Path;
Fetching artwork for /Users/Guille/Volumes/series/Da Vinci's Demons/Season 2 from TheTVDB
MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.fetchSeriesArtworkAndNfo() is applicable for argument types: (java.io.File, java.io.File, net.sourceforge.filebot.web.TheTVDBSearchResult, java.lang.Integer) values: [/Users/Guille/Volumes/series/Da Vinci's Demons, /Users/Guille/Volumes/series/Da Vinci's Demons/Season 2, ...]
groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.fetchSeriesArtworkAndNfo() is applicable for argument types: (java.io.File, java.io.File, net.sourceforge.filebot.web.TheTVDBSearchResult, java.lang.Integer) values: [/Users/Guille/Volumes/series/Da Vinci's Demons, /Users/Guille/Volumes/series/Da Vinci's Demons/Season 2, ...]
at Script3$_run_closure37_closure75.doCall(Script3.groovy:223)
at Script3$_run_closure37.doCall(Script3.groovy:214)
at Script3.run(Script3.groovy:197)
at net.sourceforge.filebot.cli.ScriptShell.evaluate(ScriptShell.java:91)
at net.sourceforge.filebot.cli.ScriptShell.runScript(ScriptShell.java:85)
at net.sourceforge.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:123)
at net.sourceforge.filebot.Main.main(Main.java:192)
Failure (°_°)
logout
[Process completed]
Thx for you patience.
rednoah
The Source
Posts: 23935 Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:
Post
by rednoah » 04 May 2014, 18:41
Missing dependency:
Code: Select all
FileNotFoundException: /Users/Guille/Documents/Scripts/lib/htpc.groovy (No such file or directory)
The amc script might require other scripts depending on which features you activate. So it's best to clone the whole github repo.