Encode poster title to UTF-8 for Imgur upload
This commit is contained in:
@@ -543,8 +543,8 @@ def uploadToImgur(imgPath, imgTitle=''):
|
|||||||
data = {'type': 'base64',
|
data = {'type': 'base64',
|
||||||
'image': base64.b64encode(img)}
|
'image': base64.b64encode(img)}
|
||||||
if imgTitle:
|
if imgTitle:
|
||||||
data['title'] = imgTitle
|
data['title'] = imgTitle.encode('utf-8')
|
||||||
data['name'] = imgTitle + '.jpg'
|
data['name'] = imgTitle.encode('utf-8') + '.jpg'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
request = urllib2.Request('https://api.imgur.com/3/image', headers=headers, data=urllib.urlencode(data))
|
request = urllib2.Request('https://api.imgur.com/3/image', headers=headers, data=urllib.urlencode(data))
|
||||||
|
Reference in New Issue
Block a user