From a4c5920e68c0d7972e6b21f87f6b8d5214390744 Mon Sep 17 00:00:00 2001 From: Nico Jensen Date: Mon, 30 Oct 2023 12:45:37 +0100 Subject: [PATCH] Add Item description for ALT Text --- PixelfedImporter.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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: