From e7a2ea4d061b48ee69da8945c524eaca20513a4a Mon Sep 17 00:00:00 2001 From: yasir Date: Tue, 17 Jan 2023 17:21:40 +0700 Subject: [PATCH] Fix --- misskaty/helper/tools.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misskaty/helper/tools.py b/misskaty/helper/tools.py index 4b7fa274..baef2fb8 100644 --- a/misskaty/helper/tools.py +++ b/misskaty/helper/tools.py @@ -101,7 +101,10 @@ def get_provider(url): async def search_jw(movie_name: str, locale: str): m_t_ = "" - response = (await http.get(f"https://yasirapi.eu.org/justwatch?q={movie_name}&locale={locale}")).json() + try: + response = (await http.get(f"https://yasirapi.eu.org/justwatch?q={movie_name}&locale={locale}")).json() + except: + return m_t_ if not response.get("results"): LOGGER.error("JustWatch API Error or got Rate Limited.") return m_t_