diff --git a/PixelfedImporter.py b/PixelfedImporter.py index 9d557aa..e432213 100644 --- a/PixelfedImporter.py +++ b/PixelfedImporter.py @@ -60,7 +60,13 @@ def mediaUpload(access_token, url, file): try: with open(file, "rb") as imageFile: f = {"file": imageFile} - response = requests.post(api_url, headers=headers, files=f) + data = { + "file": (file, imageFile), + "description": "API TEST" + } + json_data = json.dumps(data) + + response = requests.post(api_url, headers=headers, files=data) response.raise_for_status() # Wirft eine HTTPError-Exception, wenn der Statuscode nicht erfolgreich ist try: