Skip to content

Instantly share code, notes, and snippets.

@neckothy
Created December 18, 2023 17:47
Show Gist options
  • Save neckothy/8668611c764ab2449fc8d42d222e5fa4 to your computer and use it in GitHub Desktop.
Save neckothy/8668611c764ab2449fc8d42d222e5fa4 to your computer and use it in GitHub Desktop.
Attempt to save ComiXology covers by checking URLs sequentially from a starting id
import requests
BASE_URL = "https://m.media-amazon.com/images/S/cmx-images-prod/Item"
START_ID = 1036934
ATTEMPTS = 10
for attempt in range(ATTEMPTS):
current_id = START_ID + attempt
with requests.get(f"{BASE_URL}/{current_id}/{current_id}.jpg") as response:
if response.status_code == 200:
print(f"{current_id}: writing to file")
with open(f"{current_id}.jpg", "wb") as f:
f.write(response.content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment