From 9cc450338879699e16c92b1ed70b3b783781b2e0 Mon Sep 17 00:00:00 2001 From: stabbedbybrick <125766685+stabbedbybrick@users.noreply.github.com> Date: Fri, 20 Sep 2024 21:28:21 +0200 Subject: [PATCH] fix(IP): Fix missing category label --- services/iP/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/iP/__init__.py b/services/iP/__init__.py index 91729b2..a2f39fc 100644 --- a/services/iP/__init__.py +++ b/services/iP/__init__.py @@ -110,7 +110,7 @@ class iP(Service): elif data is None: raise ValueError(f"Metadata was not found - if {pid} is an episode, use full URL as input") - if "Film" in data["labels"]["category"]: + if not data.get("labels") or "Film" in data.get("labels", {}).get("category", ""): data = self.session.get(self.config["endpoints"]["episodes"].format(pid=pid)).json() if not data.get("episodes"): raise ValueError(f"Metadata was not found for {pid}")