fix(IP): Fix missing category label

This commit is contained in:
stabbedbybrick 2024-09-20 21:28:21 +02:00
parent f75606dec5
commit 9cc4503388

View File

@ -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}")