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.
MBR-0001
Posts: 5
Joined: Wed Oct 06, 2021 4:02 pm

Endpoint /api/v1/subtitles fails with 400

Wed Oct 06, 2021 4:19 pm

The GET /api/v1/subtitles endpoint returns a 400 if moviehash_match is set to only and "X-Reason" header says Request parameters does not make sense

Full request URL:

Code: Select all

https://api.opensubtitles.com/api/v1/subtitles?imdb_id=0119396&languages=en&moviehash=db70805db63d34b6&moviehash_match=only
The endpoint worked until ~2 weeks ago so I'm wondering what changed and whether this is a bug or expected behavior (and if it is what should be changed in the request to make it work?)

User avatar
oss
Site Admin
Posts: 5295
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: Endpoint /api/v1/subtitles fails with 400

Wed Oct 06, 2021 5:50 pm

Hi

we did some optimising, and something broke on the way. Your client sometimes is sending as moviehash=0000000000000000 so we wanted handle this, but made mistake in regexp.

fixed.

MBR-0001
Posts: 5
Joined: Wed Oct 06, 2021 4:02 pm

Re: Endpoint /api/v1/subtitles fails with 400

Thu Oct 14, 2021 1:44 am

This continues from https://github.com/jellyfin/jellyfin-pl ... /issues/69

A few weeks ago the search subtitles endpoint stopped working because of moviehash, it was then fixed but required a query with the hash - since then the plugin has been updated to include the query.

Before the update the plugin sent the following if IMDb ID was known: moviehash + language + type + IMDb ID, if the ID was not known the plugin would send moviehash + language + type + query* + season & episode number for episodes
*Query for movies was the movie title (not file name) and for episodes the name of the TV show

After the update the following is sent:
moviehash + language + type + query* + IMDb ID (if known) + season & episode number if the ID is not known
*Query for movies was changed to file name (Baby Driver 2017 (1080p 6CH BR-HEVC PSA).mkv for example), episodes remained the same

It looks like the api now does not require query anymore so my questions are:
What data should the plugin send to get the most accurate results? If I have the IMDb ID do I use only that for identification or should I send query too? If yes should I use the file name or episode/TV show name for episodes and movie title for movies?

Why does imdb_id=4652838&languages=en&moviehash=f5ce84f53b4480f8&type=episode&query=Mr. Robot return results (19) but imdb_id=2912494&languages=en&moviehash=3918d747c95e5099&type=episode&query=The 100 doesn't? (same format and the website shows results for those episodes)
If I change the query from "The 100" to "Pilot" (name of the episode) I get results but if I change "Mr. Robot" to "eps1.0_hellofriend.mov" (also episode name) I get 0 results

And finally, what changes can be expected to the searching endpoint?

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

Re: Endpoint /api/v1/subtitles fails with 400

Fri Oct 15, 2021 11:59 am

This continues from https://github.com/jellyfin/jellyfin-pl ... /issues/69

A few weeks ago the search subtitles endpoint stopped working because of moviehash, it was then fixed but required a query with the hash - since then the plugin has been updated to include the query.

Before the update the plugin sent the following if IMDb ID was known: moviehash + language + type + IMDb ID, if the ID was not known the plugin would send moviehash + language + type + query* + season & episode number for episodes
*Query for movies was the movie title (not file name) and for episodes the name of the TV show

After the update the following is sent:
moviehash + language + type + query* + IMDb ID (if known) + season & episode number if the ID is not known
*Query for movies was changed to file name (Baby Driver 2017 (1080p 6CH BR-HEVC PSA).mkv for example), episodes remained the same

It looks like the api now does not require query anymore so my questions are:
What data should the plugin send to get the most accurate results? If I have the IMDb ID do I use only that for identification or should I send query too? If yes should I use the file name or episode/TV show name for episodes and movie title for movies?

Why does imdb_id=4652838&languages=en&moviehash=f5ce84f53b4480f8&type=episode&query=Mr. Robot return results (19) but imdb_id=2912494&languages=en&moviehash=3918d747c95e5099&type=episode&query=The 100 doesn't? (same format and the website shows results for those episodes)
If I change the query from "The 100" to "Pilot" (name of the episode) I get results but if I change "Mr. Robot" to "eps1.0_hellofriend.mov" (also episode name) I get 0 results

And finally, what changes can be expected to the searching endpoint?

So, the key thing to remember, is that the API is still under active development, it's not a finished product we provide support to, guarantee results and availability. (well, not yet)

We have been performing changes to make the API work for most consumers, including plenty for jellyfin, we are also following the raise in traffic by optimizing our performances, resulting in changes such as ordering the parameters, avoid empty ones and so on.

A general tip when using the API, if you know the imdb_id, or parent_id and episode & season number, don't send a query at all, we can put all the magic possible there, a text search will never be as precise as picking a precise ID. querying for something like "the 100" is really short, in most cases a keyword like "the" will be ignored, leaving a 3 digit dumber for the query, that's a lot of if/else trying to get the best result (even if in this case, there is an exact match) app will need to filter out through a lot of results. searching for "robot" on the other hand returns much fewer results, with an exact match on "mr robot"

well that's just 2 examples on one api consumer, to search for something in our 17'901 Tv series and 375'553 related episodes...

We are doing our best to avoid breaking changes, all the latest were related to performance improvements, other changes to expect should only be improvements, extra filters or attributes to query on, for example the latest one I'm working on is to allow searching on a moviehash only, without any other information.

Another problem was the lack of time to write proper tests for the new features, there's been a few changes just dropped in production, and some parts of the documentation were not updated.

Return to “Developing”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests