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.
User avatar
oss
Site Admin
Posts: 5878
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

[OS] Brand new REST API for testing

Fri Apr 24, 2020 7:09 am

TEST AWESOME NEW REST API - this will be our future API.

We are full time developing new site and of course we are aware of need new modern REST API. You are invited to test it.

- don't use it in production, this is just for testing
- REST API URL will be changed in future
- it comes without any warranty

Read documentation REST API DOCUMENTATION HERE:

https://www.opensubtitles.com/docs/api/html/index.htm

Let us know what you think.

nafr1
Posts: 1
Joined: Sun Dec 17, 2017 7:21 pm

Re: [OS] Brand new REST API for testing

Sun May 10, 2020 1:31 am

Not working... it just gives response 503 for all requests

achva
Posts: 2
Joined: Thu Jun 04, 2020 1:20 am

Re: [OS] Brand new REST API for testing

Thu Jun 04, 2020 2:38 am

Hi,

This is still not working.

I'm trying to login and I'm receiving this error for all requests.
I have the same user and password to both sites (opensubtitles.org and opensubtitles.com beta), and I'm not sending the wrong user/password.

{"errors":["Invalid domain"],"status":401}

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

Re: [OS] Brand new REST API for testing

Thu Jun 04, 2020 6:05 am

will be fixed soon, we are in process of changing endpoint and it is not finished yet

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

Re: [OS] Brand new REST API for testing

Thu Jun 04, 2020 1:14 pm

it's working now. I also published my work in progress for the documentation that looks a bit better now

achva
Posts: 2
Joined: Thu Jun 04, 2020 1:20 am

Re: [OS] Brand new REST API for testing

Thu Jun 04, 2020 2:43 pm

It's working now. Thanks.

Falsyana
Posts: 3
Joined: Wed Jul 15, 2020 10:00 am

Re: [OS] Brand new REST API for testing

Wed Jul 15, 2020 10:05 am

So I am trying to migrate my app to the new API but I seem to fail at the first step: login.

According to the documentation login should be as easy as:
curl "https://www.opensubtitles.com/api/v1/login" -d '{
"username": "testuser",
"password": "password"
}' -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json"

But whenever I do this with my username/password i get the 401 unauthorized result.

It is the same username & password combination I use to login on the website (https://www.opensubtitles.com/en#modal-login).
Should I be using a different account? Or did I miss a step?

Thanks!

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

Re: [OS] Brand new REST API for testing

Wed Jul 15, 2020 4:06 pm

So I am trying to migrate my app to the new API but I seem to fail at the first step: login.

According to the documentation login should be as easy as:
curl "https://www.opensubtitles.com/api/v1/login" -d '{
"username": "testuser",
"password": "password"
}' -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json"

But whenever I do this with my username/password i get the 401 unauthorized result.

It is the same username & password combination I use to login on the website (https://www.opensubtitles.com/en#modal-login).
Should I be using a different account? Or did I miss a step?

Thanks!
Hi,

Oh that's strange, this should be working as described, using your regular login/password from opensubtitles.com
it's really important that the X POST is specified, as well as the 2 headers

But... are you using shell actually ? if you don't know it yet, try postman https://www.postman.com/downloads/

note about the migration.... we are clear that for now it's for development only right ? (still updates and optimization necessary before production use)

let me know if it works

cheers

Falsyana
Posts: 3
Joined: Wed Jul 15, 2020 10:00 am

Re: [OS] Brand new REST API for testing

Wed Jul 15, 2020 4:49 pm

Heya,

Yes I am using shell (bash) and kinda copy pasted it:

Code: Select all

# curl "https://www.opensubtitles.com/api/v1/login" -d '{"username": "falsyana", "password": "xxxxxxxxxxxxx"}' -X POST -H "Accept: application/json" -H "Content-Type: application/json" {"message":"Error, Unauthorized","status":401}
(of course my username and password are replaced)

Also my application (written in PHP) gives the same error.

And yes it is clear that is for development only :D

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

Re: [OS] Brand new REST API for testing

Thu Jul 16, 2020 9:05 am

Heya,

Yes I am using shell (bash) and kinda copy pasted it:

Code: Select all

# curl "https://www.opensubtitles.com/api/v1/login" -d '{"username": "falsyana", "password": "xxxxxxxxxxxxx"}' -X POST -H "Accept: application/json" -H "Content-Type: application/json" {"message":"Error, Unauthorized","status":401}
(of course my username and password are replaced)

Also my application (written in PHP) gives the same error.

And yes it is clear that is for development only :D
hmm, that's really strange, I'm on the API all day long, it's working fine in my postman, and ruby apps.

But I got the same error with the shell now, copying exactly your command, but if I put the X POST as first argument it works

curl -X POST "https://www.opensubtitles.com/api/v1/login" -d '{"username": "falsyana", "password": "xxxxxxxxxxxxx"}' -H "Content-Type: application/json" -H "Accept: application/json"

honeslty, I never use those, they are generated by the documentation tool, so thanks for pointing out these errors

For the PHP script, if you got a small script I can see, I'd be happy to check it out.

cheers

Falsyana
Posts: 3
Joined: Wed Jul 15, 2020 10:00 am

Re: [OS] Brand new REST API for testing

Thu Jul 16, 2020 3:43 pm

But I got the same error with the shell now, copying exactly your command, but if I put the X POST as first argument it works

curl -X POST "https://www.opensubtitles.com/api/v1/login" -d '{"username": "falsyana", "password": "xxxxxxxxxxxxx"}' -H "Content-Type: application/json" -H "Accept: application/json"
It didn't matter for me if I placed the -X argument first or last.
But I found the issue: the problem was in the username, I used a capital in there. On the website it works but I assume, before it gets validated, it's converted to lowercase. That step is probably not done through the API.

So after I changed it to all lowercase the curl and my app are working fine :D

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

Re: [OS] Brand new REST API for testing

Fri Jul 17, 2020 10:57 am

But I found the issue: the problem was in the username, I used a capital in there. On the website it works but I assume, before it gets validated, it's converted to lowercase. That step is probably not done through the API.

So after I changed it to all lowercase the curl and my app are working fine :D
Wow yes you are right !! thanks a lot for pointing it out, I will fix that !!

itstaha
Posts: 1
Joined: Fri Aug 21, 2020 5:51 pm

Re: [OS] Brand new REST API for testing

Fri Aug 21, 2020 5:56 pm

So I am trying to migrate my app to the new API but I seem to fail at the first step: login.

According to the documentation login should be as easy as:
curl "https://www.opensubtitles.com/api/v1/login" -d '{
"username": "testuser",
"password": "password"
}' -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json"

But whenever I do this with my username/password i get the 401 unauthorized result.

It is the same username & password combination I use to login on the website (https://www.opensubtitles.com/en#modal-login).
Should I be using a different account? Or did I miss a step?

Thanks!
I have the same problem but my username and password are correct!
do I need something like a level or ..?

curl --location --request POST 'https://www.opensubtitles.com/api/v1/login' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{"username": "itstaha", "password": "********"}'

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

Re: [OS] Brand new REST API for testing

Sat Aug 22, 2020 3:00 am

this is working. You probably guys doesnt have account on www.opensubtitles.com

make sure you can login on www.opensubtitles.com and use same credentials into this API

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

Re: [OS] Brand new REST API for testing

Sat Aug 22, 2020 8:21 am

The shell commands are super basic examples, they do fail once in a while for me too, then I just replace the order of parameters, add or remove a space then it works.

This is a living hell, don't code like this, instead use something like postman https://www.postman.com/downloads/

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 35 guests