mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-03 19:14:51 +00:00
Fix
This commit is contained in:
parent
2280700563
commit
d9b352d4a4
1 changed files with 3 additions and 6 deletions
|
|
@ -101,14 +101,11 @@ def get_provider(url):
|
|||
|
||||
async def search_jw(movie_name: str, locale: str):
|
||||
m_t_ = ""
|
||||
try:
|
||||
response = await http.get(f"https://yasirapi.eu.org/justwatch?q={movie_name}&locale={locale}")
|
||||
except Exception as err:
|
||||
response = (await http.get(f"https://yasirapi.eu.org/justwatch?q={movie_name}&locale={locale}")).json()
|
||||
if not response.get("results"):
|
||||
LOGGER.error("JustWatch API Error or got Rate Limited.")
|
||||
return m_t_
|
||||
soup = json.loads(response.text)
|
||||
items = soup["items"]
|
||||
for item in items:
|
||||
for item in response.get("results")["items"]:
|
||||
if movie_name == item.get("title", ""):
|
||||
offers = item.get("offers", [])
|
||||
t_m_ = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue