Merge pull request #87 from MKolman/python3-patch

Fixes the issue #60 for Python3
This commit is contained in:
Taehoon Kim
2017-01-30 21:42:14 +09:00
committed by GitHub

View File

@@ -339,6 +339,8 @@ class Client(object):
:param image: a tuple of (file name, data, mime type) to upload to facebook
"""
r = self._postFile(UploadURL, image)
if isinstance(r._content, str) is False:
r._content = r._content.decode("utf-8")
# Strip the start and parse out the returned image_id
return json.loads(r._content[9:])['payload']['metadata'][0]['image_id']