Created
November 7, 2023 22:42
-
-
Save cfjedimaster/14d7b790ba86745d436a6baa964e43e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| job = create_removebg_job(CLIENT_ID, token, inputURL, uploadURL) | |
| jobUrl = job["_links"]["self"]["href"] | |
| status = "" | |
| while status != 'succeeded' and status != 'failed': | |
| response = requests.get(jobUrl, headers = {"Authorization": f"Bearer {token}", "x-api-key": CLIENT_ID }) | |
| json_response = response.json() | |
| status = json_response["status"] | |
| print(json_response) | |
| print(f"Current status: {status }") | |
| if status != 'succeeded' and status != 'failed': | |
| time.sleep(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment