For XBMC there exist an Add-on that searches a bunch of different sites for subtitles. It would be great if it were possible to reuse and extend the OpenSubtitles Agent to support more sources…
Here is a link to the xbmc.script: http://github.com/amet/script.xbmc.subtitles/tree/master/script.xbmc.subtitles/resources/lib/services
I’ve started a bit on implementing support for undertexter.se but I’m a bit stuck, in the opensubtitles.org agent they are using p.openSubtitleHash, what other variables can be found for the “p” object?
I would like to have the whole filename to match with (i.e. Tron.Legacy.2010.BluRay.720p.DTS.x264-CHD) that will match the exactly right sub for me, is that some how possible?
What methods can I use in my agent, am I allowed to do import of other libs and what libs/methods are available?
def update(self, metadata, media, lang):<br />
HTTP.Headers['User-agent'] = 'plexapp.com v9.0'<br />
<br />
proxy = XMLRPC.Proxy(OS_API)<br />
for i in media.items:<br />
for p in i.parts:<br />
token = proxy.LogIn('', '', 'en', OS_PLEX_USERAGENT)['token']<br />
langList = [Prefs["langPref1"]]<br />
if Prefs["langPref2"] != 'None':<br />
langList.append(Prefs["langPref2"])<br />
for l in langList:<br />
Log('Looking for match for GUID %s and size %d' % (p.openSubtitleHash, p.size))<br />
subtitleResponse = proxy.SearchSubtitles(token,[{'sublanguageid':l, 'moviehash':P.openSubtitleHash, 'moviebytesize':str(p.size)}])['data']