Change forgotten hardcoded album id

master
Quentin Duchemin 2019-10-09 14:28:41 +02:00
parent 44c31e3f4a
commit 0a468af018
Signed by: Chosto
GPG Key ID: 0547178FEEDE7D6B
1 changed files with 4 additions and 4 deletions

View File

@ -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")