-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I am trying to work on my website's YOURLS API with the Python wrapper.
client = yourls.YOURLSClient('http://gediscount.ga/cb/yourls-api.php',signature='xxx')
url = client.shorten('https://google.com',keyword='google')
But I am getting this error:
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
s= client.shorten('https://google.com',keyword='google')
File "C:\Users\Prashant\AppData\Local\Programs\Python\Python36\lib\site-packages\yourls\core.py", line 77, in shorten
jsondata = self._api_request(params=data)
File "C:\Users\Prashant\AppData\Local\Programs\Python\Python36\lib\site-packages\yourls\core.py", line 32, in _api_request
jsondata = _validate_yourls_response(response, params)
File "C:\Users\Prashant\AppData\Local\Programs\Python\Python36\lib\site-packages\yourls\data.py", line 152, in _validate_yourls_response
jsondata = response.json()
File "C:\Users\Prashant\AppData\Local\Programs\Python\Python36\lib\site-packages\requests\models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\Prashant\AppData\Local\Programs\Python\Python36\lib\site-packages\simplejson\__init__.py", line 518, in loads
return _default_decoder.decode(s)
File "C:\Users\Prashant\AppData\Local\Programs\Python\Python36\lib\site-packages\simplejson\decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "C:\Users\Prashant\AppData\Local\Programs\Python\Python36\lib\site-packages\simplejson\decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
When I go to the API URL in a web browser, it returns data in XML format. I guess perhaps this is the problem as I cannot set the output format to JSON.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels