googlebooks
googlebooks copied to clipboard
feed decoded content to json.loads to avoid error
there is an error occurs.
api._get('/volumes',params) Traceback (most recent call last): File "
", line 1, in File "/usr/local/lib/python3.5/site-packages/googlebooks.py", line 18, in _get return json.loads(resp.content) File "/usr/local/lib/python3.5/json/init.py", line 312, in loads s.class.name)) TypeError: the JSON object must be str, not 'bytes'
solution: use the below instead json.loads(resp.content.decode('utf-8'))