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: 6037
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: [NEW] REST search, JSON results

Mon Feb 25, 2019 5:48 am

perfect thx

pirasalbe
Posts: 9
Joined: Tue Feb 19, 2019 2:31 pm

Re: [NEW] REST search, JSON results

Thu Feb 28, 2019 11:00 pm

I finally managed to build a very little sample app that performs a search using these rest api.
Here you can read the code.

I hope it helps :)

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

Re: [NEW] REST search, JSON results

Fri Mar 01, 2019 3:30 am

very cool. We have also suggestions (while you type), what about implement that one ?

mntgoat
Posts: 47
Joined: Thu Sep 24, 2015 10:41 pm

Re: [NEW] REST search, JSON results

Fri Mar 01, 2019 7:30 pm

So one of my users downloads the subtitle and gets this on the screen "In order to continue OpenSubtitles subtitles service you need to Log In".

How can they log in with this new API?

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

Re: [NEW] REST search, JSON results

Sat Mar 02, 2019 2:59 am

there is no login method yet, he is using VPN or other proxy (banned IP). When I will find time and power I will create this, I know it is needed.

we are preparing completely new API with so much more options (from opensubtitles.com)

mntgoat
Posts: 47
Joined: Thu Sep 24, 2015 10:41 pm

Re: [NEW] REST search, JSON results

Sat Mar 02, 2019 4:22 am

I'll let them know.

Any idea how much the new api will change and when it will be available? I'm getting close to porting my android code to ios and I would hate to have to write it twice.

Thanks.

pirasalbe
Posts: 9
Joined: Tue Feb 19, 2019 2:31 pm

Re: [NEW] REST search, JSON results

Sat Mar 02, 2019 5:50 pm

very cool. We have also suggestions (while you type), what about implement that one ?
Cool, where can I find more about it??

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

Re: [NEW] REST search, JSON results

Sun Mar 03, 2019 6:42 am

it was implemented on main www.opensubtitles.org once user write something in search box, but more correct implementation is online now:

Code: Select all

curl -A 'TemporaryUserAgent' http://rest.opensubtitles.org/suggest/query-a/sublanguageid-eng
query must come before sublanguageid. We are returning a lot of interesting data there:

Code: Select all

{ "name":"Alita: Battle Angel", "year":"2019", "total":"23", "idmovie":124839, "pic":"https://static2.opensubtitles.org/gfx/thumbs/6/8/0/7/0437086.jpg", "kind":"movie", "rating":"7.6" }, ...
let us know if it is useful for you, and send example. Also I sent you PM...

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

Re: [NEW] REST search, JSON results

Mon Mar 04, 2019 8:48 am

we added authentication:

Code: Select all

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, either use http basic auth, or add sid parameter into download link.

mntgoat
Posts: 47
Joined: Thu Sep 24, 2015 10:41 pm

Re: [NEW] REST search, JSON results

Mon Mar 04, 2019 5:15 pm

Should I make all users log in like I used to with the old api?

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

Re: [NEW] REST search, JSON results

Wed Mar 06, 2019 9:54 am

well, it is mostly useful for download, you can authenticate them, but it is not really needed. When doing download, the best is use HTTP Basic auth within download request

mntgoat
Posts: 47
Joined: Thu Sep 24, 2015 10:41 pm

Re: [NEW] REST search, JSON results

Wed Mar 06, 2019 4:41 pm

I see and I guess I can do this only for users who are banned? Is there an easy way to know this authentication will be required and more importantly, is there a way for me to test this without having to find a banned vpn ip?

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

Re: [NEW] REST search, JSON results

Thu Mar 07, 2019 12:09 pm

Hi

not really only for those users. Many users are VIP and they would like to use their limits - 1000 subtitles downloads per 24 hours instead of 200 subtitles. Also it is very very useful for those who are on VPN, because they need to log in.

If you want to try you are successfully logged in, in every REST response I can add if user is logged in or not (HTTP header X-Auth-Request: Yes|No) or something like that.

mntgoat
Posts: 47
Joined: Thu Sep 24, 2015 10:41 pm

Re: [NEW] REST search, JSON results

Thu Mar 07, 2019 6:13 pm

Ok I can easily add an optional login. I use to have that on the old api as well.

My question is, when it fails because the ip is banned and the user needs to log in, how will I know that happened? and it is there a way for me to test that kind of response while writing the code?

Thanks.

martins_brn
Posts: 1
Joined: Mon Mar 18, 2019 7:21 pm

Re: [NEW] REST search, JSON results

Mon Mar 18, 2019 7:43 pm

Hello,

I'm using this rest API for two months and now i'm receiveing the 301 HTTP Status (301 Moved Permanently)

Example URL: https://rest.opensubtitles.org/search/m ... ageid-pob/
Response Code: 301
Response Message: Moved Permanently
Response: sun.net.www.MessageHeader@1f9d83918 pairs: {null: HTTP/1.1 301 Moved Permanently}{Date: Mon, 18 Mar 2019 17:07:41 GMT}{Content-Type: text/html; charset=UTF-8}{Transfer-Encoding: chunked}{Connection: keep-alive}{Set-Cookie: __cfduid=dd349638f1e25c6b0c1ec0100d2f6a10e1552928861; expires=Tue, 17-Mar-20 17:07:41 GMT; path=/; domain=.opensubtitles.org; HttpOnly}{Location: http://rest.opensubtitles.org/search/mo ... -pob}{Vary: Accept-Encoding}{X-Cache-Backend: web5}{X-Cache: MISS}{X-RateLimit-Remaining: 39}{X-Via: fw2.int.opensubtitles.org}{CF-Cache-Status: HIT}{Expires: Tue, 19 Mar 2019 05:07:41 GMT}{Cache-Control: public, max-age=43200}{Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-c ... t"}{Server: cloudflare}{CF-RAY: 4b98cdea7b90ccec-EWR}

This URL has been modified recently?

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 1 guest