Change forgotten hardcoded album id
parent
44c31e3f4a
commit
0a468af018
|
@ -107,12 +107,12 @@ def upload_image(session, album_id, binary_img, img_format):
|
||||||
img_mime += 'png'
|
img_mime += 'png'
|
||||||
else:
|
else:
|
||||||
raise ValueError("Invalid image format {0}!".format(img_format))
|
raise ValueError("Invalid image format {0}!".format(img_format))
|
||||||
data = {'albumID': '15510292135273'}
|
data = {'albumID': album_id}
|
||||||
files = {'0': (str(uuid.uuid4()) + "." + img_format, binary_img, img_mime)}
|
files = {'0': (str(uuid.uuid4()) + "." + img_format, binary_img, img_mime)}
|
||||||
r = requests.Request('POST', SCREENSHOT_CONFIG['base_url'] + '/api/Photo::add', data=data, files=files)
|
r = requests.Request('POST', SCREENSHOT_CONFIG['base_url'] + '/api/Photo::add', data=data, files=files)
|
||||||
dump = session.prepare_request(r)
|
dump = session.prepare_request(r)
|
||||||
r = session.post(SCREENSHOT_CONFIG['base_url'] + '/api/Photo::add', data=data, files=files)
|
r = session.post(SCREENSHOT_CONFIG['base_url'] + '/api/Photo::add', data=data, files=files)
|
||||||
|
print(r.text)
|
||||||
if "Error" in r.text:
|
if "Error" in r.text:
|
||||||
raise RuntimeError("Unknown error while uploading picture")
|
raise RuntimeError("Unknown error while uploading picture")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue