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.
nsgr
Posts: 7
Joined: Tue Jan 11, 2022 10:39 pm

Re: Open subtitles API download issue

Thu Jan 13, 2022 6:57 pm

Update :
I was so confused cuz i got the problem again. Then i downloaded the python api to see if it get the same error and i got no error...
I compared the requests made by the python api and my curl requests and i found the difference.
The Bearer wasn't the problem. I had to use "https://www.opensubtitles.com/api/v1/download" instead of "https://api.opensubtitles.com/api/v1/download".
I'm not sure why the subdomain "api.opensubtitles.com" results in a 500 Error on the download link for me.

Just wanted to share my experience if others have the same problem.

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

Re: Open subtitles API download issue

Fri Jan 14, 2022 6:32 am

I can not confirm this. Actually it seems "Bearer" is optional, it can be there, but doesn't have to be (for standard, we are putting it there and it SHOULD be there). Try with different file_id and play a bit and I hope you will confirm this

nsgr
Posts: 7
Joined: Tue Jan 11, 2022 10:39 pm

Re: Open subtitles API download issue

Sun Jan 16, 2022 6:28 pm

I can not confirm this. Actually it seems "Bearer" is optional, it can be there, but doesn't have to be (for standard, we are putting it there and it SHOULD be there). Try with different file_id and play a bit and I hope you will confirm this
Yes, "Bearer" wasn't the problem as stated in my update post. It wasn't working because i used "https://api.opensubtitles.com/api/v1/download". I had to use "https://www.opensubtitles.com/api/v1/download". Not sure why i get the 500 Error with the api.opensubtitles Subdomain tho.

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

Re: Open subtitles API download issue

Sun Jan 16, 2022 7:29 pm

I can not confirm this. Actually it seems "Bearer" is optional, it can be there, but doesn't have to be (for standard, we are putting it there and it SHOULD be there). Try with different file_id and play a bit and I hope you will confirm this
Yes, "Bearer" wasn't the problem as stated in my update post. It wasn't working because i used "https://api.opensubtitles.com/api/v1/download". I had to use "https://www.opensubtitles.com/api/v1/download". Not sure why i get the 500 Error with the api.opensubtitles Subdomain tho.
need to track the problem further, "Bearer" is required as described in the docs, and the url to be used must be api.opensubtitles.com, www.opensubtitles.com only work to access the api temporarily and will be disabled in time, so better solve it now.

may I ask, what are you using for testing ?

nsgr
Posts: 7
Joined: Tue Jan 11, 2022 10:39 pm

Re: Open subtitles API download issue

Sun Jan 16, 2022 10:54 pm

I can not confirm this. Actually it seems "Bearer" is optional, it can be there, but doesn't have to be (for standard, we are putting it there and it SHOULD be there). Try with different file_id and play a bit and I hope you will confirm this
Yes, "Bearer" wasn't the problem as stated in my update post. It wasn't working because i used "https://api.opensubtitles.com/api/v1/download". I had to use "https://www.opensubtitles.com/api/v1/download". Not sure why i get the 500 Error with the api.opensubtitles Subdomain tho.
need to track the problem further, "Bearer" is required as described in the docs, and the url to be used must be api.opensubtitles.com, www.opensubtitles.com only work to access the api temporarily and will be disabled in time, so better solve it now.

may I ask, what are you using for testing ?
I'm just using a small bash script with curl for testing. I just changed the URL back to api.opensubtitles and it works. Maybe it was a typo on my end.
I'm sorry about the confusion and thanks for the help!

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

Re: Open subtitles API download issue

Mon Jan 17, 2022 10:06 am

www.opensubtitles.com SHOULDN'T be used for any API requests.

[email protected]

Re: Open subtitles API download issue

Thu Feb 10, 2022 9:05 pm

Hello, I am having the same problem. Everything is working fine exept that the download link isn't. For example https://www.opensubtitles.com/download/ ... 352806.srt gives me
"Error 500
Oooops. We are down.
But don't worry, we will be back up shortly."
Thanks for your help.

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

Re: Open subtitles API download issue

Fri Feb 11, 2022 6:50 am

hi, that link is already expired. What is file_id ?

[email protected]

Re: Open subtitles API download issue

Fri Feb 11, 2022 12:05 pm

Thanks for your answer. I don't remember the file_id so I'll generate a couple of new ones.

This is file_id = 807627 https://www.opensubtitles.com/download/ ... 352806.srt

and this is file_id = 207708 https://www.opensubtitles.com/download/ ... 352806.srt

UPDATE

Turns out I was mixing up the subtitle id with the file id, but it still doesn't work:

file_id = 215080 gives me https://www.opensubtitles.com/download/ ... string.srt

and file_id = 5047678 gives me https://www.opensubtitles.com/download/ ... string.srt

UPDATE 2

Ok the links seem to work now, so it was my mistake. Sorry for wasting your time and thanks for your help.
Last edited by [email protected] on Fri Feb 11, 2022 1:44 pm, edited 2 times in total.

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

Re: Open subtitles API download issue

Fri Feb 11, 2022 1:50 pm



UPDATE 2

Ok the links seem to work now, so it was my mistake. Sorry for wasting your time and thanks for your help.
oh don't worry about this, debugging is my life. Also, I could fix a little bug while tracking your downloads, so was a helpful post !

[email protected]

Re: Open subtitles API download issue

Fri Feb 11, 2022 2:48 pm

oh don't worry about this, debugging is my life. Also, I could fix a little bug while tracking your downloads, so was a helpful post !
Happy to "help" :D

usman_click
Posts: 1
Joined: Fri Sep 16, 2022 1:32 am

Re: Open subtitles API download issue

Mon Sep 19, 2022 6:17 am

Re: Open subtitles API download issue

Helllo, i ran into the same issue


Java OkHttpClient Request

Code: Select all

OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\n \"file_id\": 7654844\n}"); Request request = new Request.Builder() .url("https://api.opensubtitles.com/api/v1/download") .post(body) .addHeader("Content-Type", "application/json") .addHeader("Api-Key", "API-KEY") .addHeader("Authorization", "Bearer <TOKEN>") .build();


Response

Code: Select all

Response{protocol=h2, code=406, message=, url=https://api.opensubtitles.com/api/v1/download}

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

Re: Open subtitles API download issue

Mon Sep 19, 2022 4:08 pm

Re: Open subtitles API download issue

Helllo, i ran into the same issue


Java OkHttpClient Request

Code: Select all

OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\n \"file_id\": 7654844\n}"); Request request = new Request.Builder() .url("https://api.opensubtitles.com/api/v1/download") .post(body) .addHeader("Content-Type", "application/json") .addHeader("Api-Key", "API-KEY") .addHeader("Authorization", "Bearer <TOKEN>") .build();


Response

Code: Select all

Response{protocol=h2, code=406, message=, url=https://api.opensubtitles.com/api/v1/download}

Please experiment with the API using a program such as Postman or Insomnia, then if a request is causing problem, you can copy it as CURL and post it here.

qacomohibeb
Posts: 2
Joined: Wed Apr 12, 2023 5:24 pm

Re: Open subtitles API download issue

Wed Apr 12, 2023 5:43 pm

Hi,

I'm having some issues with the new API:

Login goes just fine and I'm getting this reply (redacted):

Code: Select all

{'user': {'allowed_translations': 10, 'allowed_downloads': 1000, 'remaining_downloads': 1000, 'level': 'VIP Member', 'user_id': xxxxxx, 'ext_installed': False, 'vip': True}, 'token': 'ey...50', 'status': 200}
So: I have 1000 remaining downloads.
However, when attempting to download I'm immediately getting:

Code: Select all

{'requests': 7, 'remaining': -2, 'message': 'You have downloaded your allowed 5 subtitles for 24h.Your quota will be renewed in 17 hours and 46 minutes (2023-04-13 09:25:43 UTC) ', 'reset_time': '17 hours and 46 minutes', 'reset_time_utc': '2023-04-13T09:25:43.000Z'}
What's going on?

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

Re: Open subtitles API download issue

Wed Apr 12, 2023 11:36 pm

Hi
of course you read docs here
https://opensubtitles.stoplight.io/docs ... 8-download and of course you are passing also the first warning on that page, stating
"In HTTP request must be both headers: Api-Key and Authorization"

Are you 100% sure you are passing those parameters, because it seems Authorization is missing.

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 29 guests