diff --git a/processor/requirements.txt b/processor/requirements.txt index 6b7703d..7b72ba2 100644 --- a/processor/requirements.txt +++ b/processor/requirements.txt @@ -24,5 +24,5 @@ tqdm==4.65.0 trio==0.22.0 trio-websocket==0.10.2 urllib3==1.26.15 -webdriver-manager==3.8.6 +webdriver-manager==4.0.2 wsproto==1.2.0 diff --git a/processor/src/curse_api.py b/processor/src/curse_api.py index 2420700..858a0f1 100644 --- a/processor/src/curse_api.py +++ b/processor/src/curse_api.py @@ -26,8 +26,13 @@ def get_modid(slug: str, logmsg: Callable[[str], None]) -> Union[str, None]: logmsg(f"🔥 Failed to get mod_id for {slug}.") return None - mod_id = response.json()["data"][0]["id"] - return mod_id + response_json = response.json() + try: + mod_id = response_json["data"][0]["id"] + return mod_id + except IndexError: + logmsg(f"🔥 Failed to get mod_id for {slug}") + return None except TimeoutError: logmsg("🕜 Timed out getting mod_id from slug") return None