From 640675a7464446e7af521876b569d85aa6ae40ce Mon Sep 17 00:00:00 2001 From: tooomm Date: Sat, 10 Jan 2026 18:55:44 +0100 Subject: [PATCH] Add 100ms delay between requests --- magic_spoiler/__main__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/magic_spoiler/__main__.py b/magic_spoiler/__main__.py index 3d5c5947..03bf481c 100644 --- a/magic_spoiler/__main__.py +++ b/magic_spoiler/__main__.py @@ -102,6 +102,8 @@ def json_download(scryfall_url: str) -> Dict[str, Any]: """ session = __get_session() response: Any = session.get(url=scryfall_url, timeout=10.0) + if not response.from_cache: + time.sleep(0.1) # 100ms delay for good citizenship (10 requests per second) request_api_json: Dict[str, Any] = response.json() print("Downloaded: {} (Cache = {})".format(scryfall_url, response.from_cache)) return request_api_json