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: 13
Joined: Wed Oct 06, 2021 4:02 pm

Re: [OS] Brand new REST API for testing

Tue Mar 29, 2022 5:33 pm

Hi, it looks like the ratelimit headers are not present in responses anymore, I tested the search and download endpoints and none of them returned them

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

Re: [OS] Brand new REST API for testing

Thu Mar 31, 2022 6:56 am

thats right, for some reason we had to disable it, because it was not counted properly and clients get 429 errors in cases, where they shouldn't :(

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

Re: [OS] Brand new REST API for testing

Sun Apr 03, 2022 9:59 pm

thats right, for some reason we had to disable it, because it was not counted properly and clients get 429 errors in cases, where they shouldn't :(
Will the headers be the same as they were when they are added back? If not, could you put it in the api changelog?

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

Re: [OS] Brand new REST API for testing

Mon Apr 04, 2022 5:24 am

we would like to give back the headers, because there should be some limits of not overloading API. I will update DOCS, in case the header is missing.

dylanredfield
Posts: 1
Joined: Mon Apr 04, 2022 1:39 pm

Re: [OS] Brand new REST API for testing

Mon Apr 04, 2022 1:51 pm

I can send a download post no problem using curl or python but when I attempt via golang I'm getting a strange 406 response with no message and this as the body. Seeing the references to cloudflare make me worry I'm being caught in a fliter. Here is my simplified code that illustrates the issue. The inline code isn't formatting well so here it is also as a pastebin: https://pastebin.com/XruvAPgs

Code: Select all

var testData = []byte(`{"file_id": 1234}`) downloadReq, err := http.NewRequest("POST", "https://api.opensubtitles.com/api/v1/download", bytes.NewBuffer(testData)) downloadReq.Header.Add("Api-Key", "WITHHELD_FOR_POST") downloadReq.Header.Add("Content-Type", "application/json") downloadReq.Header.Add("User-Agent", "leshmoa/1.0") downloadResp, err := http.DefaultClient.Do(downloadReq)

Code: Select all

map[X-Var-Cache:[MISS] X-Via:[fw1] Strict-Transport-Security:[max-age=15552000; includeSubDomains; preload] Date:[Mon, 04 Apr 2022 11:29:11 GMT] X-Runtime:[0.169147] Access-Control-Allow-Origin:[*] Cf-Cache-Status:[DYNAMIC] Server:[cloudflare] Content-Type:[text/html; charset=UTF-8] X-Kong-Proxy-Latency:[1] Age:[0] Cf-Ray:[6f69b46f6b487691-LHR] X-Content-Type-Options:[nosniff] Alt-Svc:[h3=":443"; ma=86400, h3-29=":443"; ma=86400] X-Request-Id:[c10c4b51-c1a9-4e4f-81bb-43a5e2abedf4] X-Kong-Upstream-Latency:[177] X-Cache-Backend:[apigw1_8000 rb1-new] Expect-Ct:[max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"] Report-To:[{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=R67couPj45b811R1nmz6IUngtmQ6Whxe1TsD9Q8r1XqNY%2BUBLYaBYsnbh%2BuAOJqWbwknGfRIKCWd%2BqeTNYWuxsa7HLZVEjnpo%2FJcFr84NxCekxxrHefAmKm4DP3MkSJSJSTq7UhVI6DWZc3wf9YbwS80wa4%3D"}],"group":"cf-nel","max_age":604800}] Nel:[{"success_fraction":0,"report_to":"cf-nel","max_age":604800}]]
Last edited by dylanredfield on Mon Apr 04, 2022 2:25 pm, edited 1 time in total.

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

Re: [OS] Brand new REST API for testing

Thu Apr 07, 2022 9:57 pm

I can send a download post no problem using curl or python but when I attempt via golang I'm getting a strange 406 response with no message and this as the body. Seeing the references to cloudflare make me worry I'm being caught in a fliter. Here is my simplified code that illustrates the issue. The inline code isn't formatting well so here it is also as a pastebin: https://pastebin.com/XruvAPgs

Code: Select all

var testData = []byte(`{"file_id": 1234}`) downloadReq, err := http.NewRequest("POST", "https://api.opensubtitles.com/api/v1/download", bytes.NewBuffer(testData)) downloadReq.Header.Add("Api-Key", "WITHHELD_FOR_POST") downloadReq.Header.Add("Content-Type", "application/json") downloadReq.Header.Add("User-Agent", "leshmoa/1.0") downloadResp, err := http.DefaultClient.Do(downloadReq)

Code: Select all

map[X-Var-Cache:[MISS] X-Via:[fw1] Strict-Transport-Security:[max-age=15552000; includeSubDomains; preload] Date:[Mon, 04 Apr 2022 11:29:11 GMT] X-Runtime:[0.169147] Access-Control-Allow-Origin:[*] Cf-Cache-Status:[DYNAMIC] Server:[cloudflare] Content-Type:[text/html; charset=UTF-8] X-Kong-Proxy-Latency:[1] Age:[0] Cf-Ray:[6f69b46f6b487691-LHR] X-Content-Type-Options:[nosniff] Alt-Svc:[h3=":443"; ma=86400, h3-29=":443"; ma=86400] X-Request-Id:[c10c4b51-c1a9-4e4f-81bb-43a5e2abedf4] X-Kong-Upstream-Latency:[177] X-Cache-Backend:[apigw1_8000 rb1-new] Expect-Ct:[max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"] Report-To:[{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=R67couPj45b811R1nmz6IUngtmQ6Whxe1TsD9Q8r1XqNY%2BUBLYaBYsnbh%2BuAOJqWbwknGfRIKCWd%2BqeTNYWuxsa7HLZVEjnpo%2FJcFr84NxCekxxrHefAmKm4DP3MkSJSJSTq7UhVI6DWZc3wf9YbwS80wa4%3D"}],"group":"cf-nel","max_age":604800}] Nel:[{"success_fraction":0,"report_to":"cf-nel","max_age":604800}]]
Try setting the accept header to */* or application/json

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

Re: [OS] Brand new REST API for testing

Fri Apr 08, 2022 6:08 am

will update docs, accept header is needed in this case. Also don't forget to send Authorization header (token from logged in user)

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

Re: [OS] Brand new REST API for testing

Mon Apr 11, 2022 7:14 pm

I noticed the ratelimit headers are back and working, that's nice to see :D

Also, could you check what's going on with subtitle with file_id 6972559? The download url returned by /api/v1/download returns an empty response

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

Re: [OS] Brand new REST API for testing

Mon Apr 11, 2022 7:38 pm


Also, could you check what's going on with subtitle with file_id 6972559? The download url returned by /api/v1/download returns an empty response
some weirdly formatted SSA file that the system doesn't recognise... can happen sometimes unfortunately, subtitle is now disabled and won't be fixed.

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

Re: [OS] Brand new REST API for testing

Wed Apr 13, 2022 10:22 am

yep, the limits are back, basically just login is hitting this limit so far, I changed 1 login per 1 second and also updated DOCS.

shleemypants
Posts: 10
Joined: Thu Sep 09, 2021 2:28 pm

Re: [OS] Brand new REST API for testing

Wed Jun 01, 2022 9:53 pm

Please kindly consider adding an endpoint for logging in without asking for username and password directly from the user.

Similar to the tmdb implementation here:
https://developers.themoviedb.org/3/aut ... session-id

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

Re: [OS] Brand new REST API for testing

Tue Jun 07, 2022 11:14 pm

Hello again!

Some users of the jellyfin opensubtitles plugin are reporting being unable to log in, this is the latest issue (link) (there's a username in the posted screenshot which might be useful for debugging).

The issue does not happen with my account so I can't really debug it so I was hoping you could maybe give it a look :?

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

Re: [OS] Brand new REST API for testing

Wed Jun 08, 2022 8:53 am

Hello again!

Some users of the jellyfin opensubtitles plugin are reporting being unable to log in, this is the latest issue (link) (there's a username in the posted screenshot which might be useful for debugging).

The issue does not happen with my account so I can't really debug it so I was hoping you could maybe give it a look :?
nothing changed with the login/passwords, all our services are up.

ElieM
Posts: 2
Joined: Wed Jun 08, 2022 11:10 pm

Re: [OS] Brand new REST API for testing

Wed Jun 08, 2022 11:17 pm

I had developed (for my own use, not commercial) a windows shell extension that downloads subtitles automatically by right clicking a video file and clicking "Fetch Subtitles", with an automatic and manual mode.

It was done using the xml-rpc API and that was working great, even better than great.

I discovered that a new website and REST API were created and that we are encouraged to migrate to the newer one, and I did. I spent like 3 days migrating the project.

I noticed so far that results coming from using the hash (my own preferred method and probably by far the best search method) are incredibly scarce. Most often than not, I get 0 results, and I make the second branch of the code do a query search (by passing the filename) to get results and that often works. I'm incredibly disappointed by this.

Also, I noticed the OpenSubtitles.com new website really lags behind the .org one in terms of results, stuff I can't find on the new website I can easily find them on the old one, for some reason I was assuming that the database behind them is the same or a replica that dumps results from the main one to the other, but it really seems to be a very different and independent one.

I would like to start using the new API instead of the old one but it's clear to me till new that it's far from ready.

This is my two cents for now, development happened on C# .Net Framework 4.8

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

Re: [OS] Brand new REST API for testing

Thu Jun 09, 2022 2:00 pm

@ElieM - thanks for info. Can you provide some examples please ?

1) on opensubtitles.com there are lets say 98% subtitles which are on opensubtitles.org (some not imported subtitles doesnt have proper format and so on)

2) so show where hash works on .org and doesnt work on .com - so we can peek into it (make sure subtitle is imported, it should be)

2 examples should be enough.

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 21 guests