Page 1 of 1

SearchSubtitles() return 401 Unauthorized

Posted: Tue May 24, 2016 2:47 pm
by burhandodhy
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);

Re: SearchSubtitles() return 401 Unauthorized

Posted: Tue May 24, 2016 9:39 pm
by vankasteelj
I don't know what language that is, but LogIn doesn't return a token, it returns an object containing the token

Re: SearchSubtitles() return 401 Unauthorized

Posted: Tue May 31, 2016 10:08 am
by MarcoTC
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.