Page 4 of 7

Re: [NEW] REST search, JSON results

Posted: Mon Feb 25, 2019 5:48 am
by oss
perfect thx

Re: [NEW] REST search, JSON results

Posted: Thu Feb 28, 2019 11:00 pm
by pirasalbe
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 :)

Re: [NEW] REST search, JSON results

Posted: Fri Mar 01, 2019 3:30 am
by oss
very cool. We have also suggestions (while you type), what about implement that one ?

Re: [NEW] REST search, JSON results

Posted: Fri Mar 01, 2019 7:30 pm
by mntgoat
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?

Re: [NEW] REST search, JSON results

Posted: Sat Mar 02, 2019 2:59 am
by oss
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)

Re: [NEW] REST search, JSON results

Posted: Sat Mar 02, 2019 4:22 am
by mntgoat
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.

Re: [NEW] REST search, JSON results

Posted: Sat Mar 02, 2019 5:50 pm
by pirasalbe
very cool. We have also suggestions (while you type), what about implement that one ?
Cool, where can I find more about it??

Re: [NEW] REST search, JSON results

Posted: Sun Mar 03, 2019 6:42 am
by oss
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...

Re: [NEW] REST search, JSON results

Posted: Mon Mar 04, 2019 8:48 am
by oss
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.

Re: [NEW] REST search, JSON results

Posted: Mon Mar 04, 2019 5:15 pm
by mntgoat
Should I make all users log in like I used to with the old api?

Re: [NEW] REST search, JSON results

Posted: Wed Mar 06, 2019 9:54 am
by oss
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

Re: [NEW] REST search, JSON results

Posted: Wed Mar 06, 2019 4:41 pm
by mntgoat
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?

Re: [NEW] REST search, JSON results

Posted: Thu Mar 07, 2019 12:09 pm
by oss
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.

Re: [NEW] REST search, JSON results

Posted: Thu Mar 07, 2019 6:13 pm
by mntgoat
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.

Re: [NEW] REST search, JSON results

Posted: Mon Mar 18, 2019 7:43 pm
by martins_brn
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?