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.
dudu1542
Posts: 3
Joined: Sun Sep 30, 2018 6:00 pm

API always gives me only 1 result for each language

Sun Sep 30, 2018 6:13 pm

Hello guys,

Currently I'm working on an application which I need the ability to search and download subtitles. I found out about OpenSubtitles API and decided to give that a try.

I tried to search subtitles for the movie 'Shrek' with the imdbid of tt0126029.
The problem is I only get 1 result for each language, whereas if I go and search manually, I get plenty more results.

I don't understand why there is a gap between the results I'm getting from the API and the results I'm getting on the website. I've learned that some subtitles are filterd in the process because they don't contain hash key. However, no matter which movie I search, I still get only 1 result for each language?

P.S I'm using a Node.js module called opensubtitles-api
https://github.com/vankasteelj/opensubtitles-api
Last edited by SmallBrother on Sun Sep 30, 2018 6:30 pm, edited 1 time in total.
Reason: Changed title to reflect content better

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

Re: API always gives me only 1 result for each language

Mon Oct 01, 2018 4:32 am

Hi

Code: Select all

limit: '3', // Can be 'best', 'all' or an // arbitrary nb. Defaults to 'best'
read wrapper docs you are using.
https://github.com/vankasteelj/opensubtitles-api

dudu1542
Posts: 3
Joined: Sun Sep 30, 2018 6:00 pm

Re: API always gives me only 1 result for each language

Wed Oct 03, 2018 7:51 pm

Thank you very much! I managed to solve this problem by simply attaching an additional query paramater 'limit' with the value of 'all'

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

Re: API always gives me only 1 result for each language

Thu Oct 04, 2018 1:21 pm

no problem. Reading the docs is always good idea before asking questions.

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 15 guests