Skip to content

Instantly share code, notes, and snippets.

@cfjedimaster
Created November 7, 2023 22:42
Show Gist options
  • Select an option

  • Save cfjedimaster/14d7b790ba86745d436a6baa964e43e6 to your computer and use it in GitHub Desktop.

Select an option

Save cfjedimaster/14d7b790ba86745d436a6baa964e43e6 to your computer and use it in GitHub Desktop.
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