From afdcc08fe722f884d2436eaf14bd76cec89296c4 Mon Sep 17 00:00:00 2001 From: tooomm Date: Sun, 22 Mar 2026 12:12:00 +0100 Subject: [PATCH] request header --- scripts/update_image_links.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/update_image_links.py b/scripts/update_image_links.py index a0ab22f..276bc75 100644 --- a/scripts/update_image_links.py +++ b/scripts/update_image_links.py @@ -39,8 +39,10 @@ def cards_collection(identifiers): payload = json.dumps({'identifiers': chunk}).encode('utf-8') req = Request('https://api.scryfall.com/cards/collection', payload, - headers={'Content-Type': 'application/json'}) - + headers={ + 'Content-Type': 'application/json', + 'User-Agent': 'Magic-Token', + 'Accept': 'application/json'}) # Rate limiting cur_time = time.time() delta_time = cur_time - start_time @@ -52,7 +54,6 @@ def cards_collection(identifiers): with urlopen(req) as f: list_obj = json.load(f) except HTTPError as e: - print(f"HTTP {e.code}") print(e.read().decode()) raise