Getting subtitles for filebot.web.Movie (or by IMDB ID)

All your suggestions, requests and ideas for future development
Post Reply
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Getting subtitles for filebot.web.Movie (or by IMDB ID)

Post by Yannik »

Hi,

after matching a movie in my custom script, I would like to download subtitles from opensubtitles by filebot.web.Movie or by specifying the IMDB id if no subtitles are found for the files hash.
Is there any function for this? Could this be added?
Thanks alot!
Yannik
Posts: 19
Joined: 22 Jul 2013, 23:47

Re: Getting subtitles for filebot.web.Movie (or by IMDB ID)

Post by Yannik »

net.filebot.WebServices.OpenSubtitles.xmlrpc.searchSubtitles(2024544, "eng"), which should query by imdbid

results in this:

NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException
at redstone.xmlrpc.XmlRpcSerializer.serialize(Unknown Source)
at redstone.xmlrpc.XmlRpcClient.invoke(Unknown Source)
at net.filebot.web.OpenSubtitlesXmlRpc.invoke(OpenSubtitlesXmlRpc.java:345)
at net.filebot.web.OpenSubtitlesClient$OpenSubtitlesXmlRpcWithRetryAndFloodLimit.invoke(OpenSubtitlesClient.java:721)
at net.filebot.web.OpenSubtitlesXmlRpc.searchSubtitles(OpenSubtitlesXmlRpc.java:99)
at net.filebot.web.OpenSubtitlesXmlRpc.searchSubtitles(OpenSubtitlesXmlRpc.java:93)
at Script1$_run_closure3.doCall(Script1.groovy:278)
at net.filebot.cli.ScriptShellMethods.eachMediaFolder(ScriptShellMethods.java:187)
at Script1.run(Script1.groovy:91)
at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:61)
at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:82)
at net.filebot.cli.ArgumentProcessor.process(ArgumentProcessor.java:116)
at net.filebot.Main.main(Main.java:169)
User avatar
rednoah
The Source
Posts: 23004
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Getting subtitles for filebot.web.Movie (or by IMDB ID)

Post by rednoah »

Have a look at class OpenSubtitlesClient as an example on how to use class OpenSubtitlesXmlRpc:
https://github.com/svn2github/filebot/b ... lient.java

Your call looks about right:
https://github.com/svn2github/filebot/b ... c.java#L92

But there's probably something unexpected happening with Groovy parameter conversion / method selection.

e.g.
* use '...' to make sure it's a String, not a GString
* use String[] instead of varargs
* try int or Integer if one or the other doesn't work
:idea: Please read the FAQ and How to Request Help.
Post Reply