Canorus / commandline-mastodon

1 stars 0 forks source link

json is complaining about bytes arrays, needs .decode() #3

Open hackerb9 opened 5 years ago

hackerb9 commented 5 years ago

The line in credential.py that runs json.loads() dies because it expects a string, not a bytes array.

To fix, append .decode() to turn it into a string like so:

credential.py: username = json.loads(requests.get(instance+'/api/v1/accounts/verify_credentials',headers={'Authorization': 'Bearer '+access_token}).content.decode())['acct']