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
vankasteelj
Posts: 175
Joined: Sun Nov 15, 2015 1:09 am

API responding too well to already uploaded sub

Wed Jun 15, 2016 9:11 pm

Hello,

If I upload a subtitle that is already in the database, by passing only an imdb id (no moviebytesize or hash), the API response status is 200 and it sends the link to that subtitle, as if I uploaded it myself.

I would expect it to send back "alreadyindb = 1" but in this case, it doesn't.

Subtitle I tried to upload: http://www.opensubtitles.org/pt/subtitl ... ite-son-pt

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

Re: API responding too well to already uploaded sub

Thu Jun 16, 2016 4:21 am

to repeat the steps:
1. you went to some URL, and download that subtitles
2. you upload it using API without moviehash and moviesize and it will send NEW URL, or OLD (1) ?

User avatar
vankasteelj
Posts: 175
Joined: Sun Nov 15, 2015 1:09 am

Re: API responding too well to already uploaded sub

Thu Jun 16, 2016 8:36 am

it sends old url, but without saying it was already uploaded, it behaves like if it was a successful new upload

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

Re: API responding too well to already uploaded sub

Thu Jun 16, 2016 9:05 am

if possible, write me here expected result. I didnt want to allow upload without moviehash, but well...

User avatar
vankasteelj
Posts: 175
Joined: Sun Nov 15, 2015 1:09 am

Re: API responding too well to already uploaded sub

Thu Jun 16, 2016 5:51 pm

I would have expected something like:

Code: Select all

{ data: 'http://opensubtitles.org/download/v/src/blah', alreadyindb: 1 seconds: 0.122 status: '200 OK' }
It currently doesn't return "alreadyindb", for some reason. It acts like if the subtitle was uploaded, but it wasnt.

Here's how I understand the response:
response.data = url to uploaded subtitle
response.seconds = time the server took to send response back
response.status = the request did hit the server and was well formed

It's missing response.alreadyindb = boolean to know if subtitle was already present or not.

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

Re: API responding too well to already uploaded sub

Fri Jun 17, 2016 7:50 am

ok, I added also in UploadSubtitles() response 'alreadyindb' - where is always 0 or 1...so now you can check.

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 28 guests