Page 1 of 1

XMLRPC API documentation issues

Posted: Thu Aug 06, 2020 8:43 pm
by adipose
I am a developer on mpc-hc (clsid2 fork, the current active fork installed with klite codec pack). I have been trying to make an improvement to the subtitle search capability, and have run into some issues.

1. Documentation is inconsistent on trac:

https://trac.opensubtitles.org/projects ... iki/XMLRPC

On this page, the api is defined for SearchSubtitles with parameters (including "tag"):

Code: Select all

array SearchSubtitles( $token, array(array('sublanguageid' => $sublanguageid, 'moviehash' => $moviehash, 'moviebytesize' => $moviesize, imdbid => $imdbid, query => 'movie name', "season" => 'season number', "episode" => 'episode number', 'tag' => tag ),array(...)), array('limit' => 500))
But at the top of the page, it suggests this link for better examples:

https://trac.opensubtitles.org/projects ... mlRpcIntro

Code: Select all

struct SearchSubtitles(string $token, array(struct('sublanguageid' => string $sublanguageid, 'moviehash' => string $moviehash, 'moviebytesize' => int $moviesize, 'imdbid' => string $imdbid ), struct(...)))
Note the two signatures are different, leading to possible confusion. This leads me to #2.

2. It seems tag search support is silently disabled, and just doesn't work.

I found a post from 2018 or 2019 saying it was disabled for performance reasons. It took me a while to find that post. Yet, the documentation states nothing about that. With two distinct signatures on the trac pages, it's enough to make you wonder if the "tag" doesn't belong in the api any longer--or are you just using it wrong? Yet, the page that mentions "tag" search is actually updated more recently.

As for performance reasons, the result of disabling tag support is, I can no longer do video filename search. This forces me to use "query" instead, and then filter the results. That must be a bigger performance hit than just searching by tag, right? Even with an exact filename, the first result is usually the right one, but is followed by 499 "close" results that I just throw away.

Is there any hope for a strict filename search, or return of tag search? It makes me sad to do such an inefficient query just because of nebulous "performance" concerns.

Re: XMLRPC API documentation issues

Posted: Fri Aug 07, 2020 5:33 am
by oss
well we disabled tag for performance reasons and it stays like that, maybe I can enable it again and see how it goes. The problem with tag is we have to index more than 72.000.000 tags (1 subtitle file can have many movie file and they can have multiple movie names)

I understand this is quite frustrating, lets hope in new REST API this will works better.

Re: XMLRPC API documentation issues

Posted: Fri Aug 07, 2020 11:07 pm
by adipose
What if you just add "filename" search and only index filenames vs. all the other kinds of tags?

Or queryexact so it doesn't match a bunch of close things?

Re: XMLRPC API documentation issues

Posted: Sat Aug 08, 2020 2:50 am
by adipose
I am not sure if my last reply was lost, or what. Seems like it disappeared?

What if we could do filename only search (and not any other tags)?

Or, for queryexact, require exact string match. The results seem to know when it's exact, so maybe a way to restrict to that.

One other idea is to index a hash of the filenames. I don't know how you are storing it, but if all records were a SHA-128 hash or something, a key lookup in a sql db should be very fast.

Re: XMLRPC API documentation issues

Posted: Sat Oct 31, 2020 3:55 pm
by oss
we tried using tags, but we have more than 61.000.000 filenames currently and it really slows down the page :(