Skip to content

Commit 94e72a0

Browse files
šŸ› (main.py): fix issue with accessing file URL in response data to ensure correct URL is retrieved and printed after file upload
1 parent f07a7f4 commit 94e72a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ā€Žmain.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ def upload_file(self, event):
118118
response = requests.post(API_UPLOAD_URL, headers=headers, files=files, timeout=10)
119119

120120
response.raise_for_status() # Raise an exception for bad responses
121-
file_url = response.json()["files"][0]
121+
response_data = response.json()["files"][0]
122+
file_url = response_data["url"]
122123
print(f"File uploaded successfully: {file_url}")
123124
pyperclip.copy(file_url) # Copy the URL to clipboard
124125

0 commit comments

Comments
Ā (0)