Forum rules
Under no circumstances is spamming or advertising of any kind allowed. Do not post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate others security. Profanity or any kind of insolent behavior to other members (regardless of rank) will not be tolerated. Remember, what you don’t find offensive can be offensive to other members. Please treat each other with the kind of reverence you’d expect from other members.
Failure to comply with any of the above will result in users being banned without notice. If any further details are needed, contact: “The team” using the link at the bottom of the forum page. Thank you.
natsunasubi
Posts: 11
Joined: Thu Jun 01, 2023 1:57 pm

API search issues

Sat Sep 30, 2023 1:40 pm

Hi, Thank you for your constant support. I am using the old API(https://rest.opensubtitles.org/search/) and am considering migrating to the new API, but there seem to be some problems with the search functionality of the new API.

1.For example, keywords with less than 3 characters, such as "saw", will result in a 400 error.
https://api.opensubtitles.com/api/v1/subtitles?languages=en&query=saw
2. For example, if you search for "titanic", you will get a lot of hits for "titan".
https://api.opensubtitles.com/api/v1/subtitles?languages=en&query=titanic

These behaviors feel a little unnatural because they are different from the old API and the web search function of opensubtitles.com.
If you have any solutions, I would appreciate it if you could let me know.

os_dev
Posts: 194
Joined: Wed Oct 17, 2018 3:42 pm

Re: API search issues

Sat Oct 07, 2023 7:24 am

Hi, Thank you for your constant support. I am using the old API(https://rest.opensubtitles.org/search/) and am considering migrating to the new API, but there seem to be some problems with the search functionality of the new API.

1.For example, keywords with less than 3 characters, such as "saw", will result in a 400 error.
https://api.opensubtitles.com/api/v1/su ... &query=saw
2. For example, if you search for "titanic", you will get a lot of hits for "titan".
https://api.opensubtitles.com/api/v1/su ... ry=titanic

These behaviors feel a little unnatural because they are different from the old API and the web search function of opensubtitles.com.
If you have any solutions, I would appreciate it if you could let me know.
the idea is to use the /features endpoint to gather the ID needed for the search. querying with 3 characters just won't work.

for the second example, this is just one use case, we have worked over thousands of cases to establish the best compromises.

but I've added a feature for you to try, you can send the parameter "title_match", and only exact matching titles will be returned (so, no "titan" with your titanic)

natsunasubi
Posts: 11
Joined: Thu Jun 01, 2023 1:57 pm

Re: API search issues

Sat Oct 07, 2023 2:33 pm

Thank you very much for your reply and response.

You're right, Titanic seems to be a special case. The reason why there are so many movies that don't even include "Titan" seems to be because the "release" item contains strings such as "AC3.TiTAN".

Also, will the new API match synonyms?
For example, if you search for "Accused", you will find many subtitles that do not even have "ac-" in the data string, and the actual movie "The Accused" will be found in the 14th place. I'm just guessing, but words like "charge", "plea" and "condemned" seem to be hits.

I tried "title_match", but it seems to only do exact matches. For example, instead of "spy family" I had to search for "spy x family".
Is it possible to limit the target to only "title" without using an exact match and without using a synonym search?

Sorry to be so selfish, but I would be happy if it were possible.
Last edited by natsunasubi on Sat Oct 07, 2023 7:15 pm, edited 1 time in total.

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 21 guests