Page 5 of 7

Re: [NEW] REST search, JSON results

Posted: Thu Mar 21, 2019 6:57 am
by oss
URLs on opensubtitles are never ending with "/". You are getting 301 to the right URL, which you should follow.
https://stackoverflow.com/questions/332 ... -upon-post

Re: [NEW] REST search, JSON results

Posted: Thu Apr 18, 2019 2:33 pm
by surajthomask
Hi, I have been trying to use the REST search and download corresponding subtitles using the url in the field `SubDownloadLink`.

Even though the search is working fine, I'm not able to download the subtitles. Below is the response I'm receiving;

Code: Select all

* Connection state changed (MAX_CONCURRENT_STREAMS updated)! < HTTP/2 400 < date: Thu, 18 Apr 2019 12:22:49 GMT < content-type: text/html; charset=UTF-8 < cache-control: private, must-revalidate, post-check=0, pre-check=0, no-store, max-age=0, s-max-age=0, max-stale=0 < x-cache-backend: web4 < x-cache: MISS < x-ratelimit-remaining: 40 < x-via: fw2.int.opensubtitles.org < cf-cache-status: MISS < expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" < vary: Accept-Encoding < server: cloudflare < cf-ray: 4c969b3d4d267002-SIN < * Connection #0 to host rest.opensubtitles.org left intact
Can you help me find out, what I'm doing wrong here? I have tried using the exact same code base to download files from other websites to verify if the code is correct or not.
Am I supposed to do a login before downloading the subtitle? If so, how is it working when copying and pasting in browser then?
Any help will be highly appreciated :-)

Re: [NEW] REST search, JSON results

Posted: Fri Apr 19, 2019 1:25 pm
by surajthomask
I was able to make the download work by removing the networking framework, and downloading directly. I have no idea why, but the download is failing when I'm hitting it through the framework. Will update here if I can find why it was behaving so.

Re: [NEW] REST search, JSON results

Posted: Sat Apr 20, 2019 8:10 am
by oss
strange, please update us with your findings

Re: [NEW] REST search, JSON results

Posted: Thu May 16, 2019 12:05 pm
by azeemcruiser

More REST methods to play with:

Code: Select all

curl -A 'TemporaryUserAgent' http://rest.opensubtitles.org/suggest/query-a/sublanguageid-eng curl -A 'TemporaryUserAgent' http://rest.opensubtitles.org/getsublanguages/language-en curl -vvv -d 'username=your_username&password=your_password' -X POST -A 'TemporaryUserAgent v1.2' https://rest.opensubtitles.org/auth curl -vvv --user username:password -A 'TemporaryUserAgent v1.2' https://rest.opensubtitles.org/auth
If you want to download subtitles as logged in user, either use http basic auth, or add sid parameter into download link.
Can you please give some details how to add SID Parameter into Download Links ?
An working link example would be great

Im using VPS server to fetch the data from OpenSubtitle and Send to my clients, now the problem is the OpenSubtitle server is limiting the downloads by IP, since im using the VPS im hitting the limits of 200 per24hous within 12hours, how can i overcome this issue ? if i become a premium member will it help ?

Re: [NEW] REST search, JSON results

Posted: Mon May 20, 2019 5:48 am
by oss
Hi

it should look like this, I will update also initial post:

Code: Select all

http://dl.opensubtitles.org/en/download/src-api/vrf-19d50c5e/sid-{YOUR_SID_HERE}/filead/1951976249.gz

Re: [NEW] REST search, JSON results

Posted: Tue Jul 30, 2019 3:36 pm
by vaurelios
Hi,

The API apparently doesn't support leading zeros, for example:

Code: Select all

https://rest.opensubtitles.org/search/episode-05/imdbid-0455275/season-05
returns a empty response while

Code: Select all

https://rest.opensubtitles.org/search/episode-5/imdbid-0455275/season-5
returns the desired response.

Is this the desired behavior (and should be handled client-side) or this is a bug?

Re: [NEW] REST search, JSON results

Posted: Mon Sep 23, 2019 11:14 pm
by KAILIYAT
hi, yes instead of standard HTTP u [spam] discord [spam] ser agent you must use the user agent, which is registered for xml-rpc. I post example using "curl" command, in every language you define different user agent, for sure you will find it.
NEW: for clients unable to change default User Agent it is possible now to set up custom HTTP header 'X-User-Agent':

Re: [NEW] REST search, JSON results

Posted: Mon Oct 14, 2019 10:26 am
by oss
Hi,

The API apparently doesn't support leading zeros, for example:

Code: Select all

https://rest.opensubtitles.org/search/episode-05/imdbid-0455275/season-05
returns a empty response while

Code: Select all

https://rest.opensubtitles.org/search/episode-5/imdbid-0455275/season-5
returns the desired response.

Is this the desired behavior (and should be handled client-side) or this is a bug?
this is working now - following redirects is important:

Code: Select all

curl -L -A 'TemporaryUserAgent' https://rest.opensubtitles.org/search/episode-05/imdbid-0455275/season-03

Re: [NEW] REST search, JSON results

Posted: Tue Dec 03, 2019 10:46 pm
by mntgoat
I have a user getting a 429 error at download time, search works fine.
There isn't any way for the user to be downloading too many subtitles with my app as it is very cumbersome to do so, but I guess I don't know if someone else on their IP is doing it.
Is there another situation in which the user might get 429 or than using opensubtitles too much?

Re: [NEW] REST search, JSON results

Posted: Wed Dec 04, 2019 4:39 am
by oss
it is not only about download. it is also about search, it is do any HTTP REQUEST to opensubtitles. If you can, try to simulate the behavior and send me log. It is counting request per IP

Re: [NEW] REST search, JSON results

Posted: Wed Dec 04, 2019 5:11 am
by mntgoat
It is going to be hard getting the user to try http requests but I can see on my logs the response from opensubtitles to search and I know the error is on the download.

For example this is something I see on my logs from my own library that uses opensubtitles:

{providerType=OPENSUBTITLES, movieHash='0', movieByteSize=0, name='Frasier.S02.Extras', kind='tv series', year='1993', episode='0', season='0', language='English', downloadUrl='https://dl.opensubtitles.org/en/downloa ... 2237883.gz', detailUrl='null', fileName=Frasier [2xExtra] - Celebrity Voices CD1.srt, format=SRT, size='4585', downloadCount=27376}

I am not sure which of those subtitles the search returns he is trying but he said no subtitles work.
Also they used to work according to him and stopped recently, without any updates of the app. No other users are complaining so it is an issue only on his end.

Thanks.

Re: [NEW] REST search, JSON results

Posted: Fri Dec 13, 2019 7:40 am
by oss
it can be his IP is blocked, without additional debug data we can just guess what is problem exactly. If it works for you and not for him, it is possible he is using VPN or other stuff. Always good to be logged in those cases.

Re: [NEW] REST search, JSON results

Posted: Fri Dec 13, 2019 1:42 pm
by mntgoat
Are there instructions for how to log in with the new api?

Re: [NEW] REST search, JSON results

Posted: Fri Dec 20, 2019 7:09 am
by oss
not yet, new API is still in developing phase.