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.
burhandodhy
Posts: 1
Joined: Tue May 24, 2016 2:04 pm

SearchSubtitles() return 401 Unauthorized

Tue May 24, 2016 2:47 pm

Hi im trying to search subtitles use SearchSubtitles() function but it always return '401 Unauthorized'

My code is

Code: Select all

include_once 'ripcord/ripcord.php'; $client=ripcord::client('https://api.opensubtitles.org/xml-rpc'); $token=$client->LogIn('******','******','en','******'); $result = $client->SearchSubtitles( $token, array( 'query' => 'south park' )) ; var_dump($result);

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

Re: SearchSubtitles() return 401 Unauthorized

Tue May 24, 2016 9:39 pm

I don't know what language that is, but LogIn doesn't return a token, it returns an object containing the token

MarcoTC
Subtitles Admin
Posts: 44
Joined: Sat Jun 13, 2015 5:15 am

Re: SearchSubtitles() return 401 Unauthorized

Tue May 31, 2016 10:08 am

Maybe you're using an incorrect UserAgent?
And it's Language Code. Not Country Code. So 'en' should be 'eng'.

If you post the actual xml-rpc request (instead of the code that generates it), it's easier to tell what's wrong.

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 25 guests