Change API and add justwatch

This commit is contained in:
yasir 2023-01-17 15:10:42 +07:00
parent 42a77965be
commit d66ad95c7a

View file

@ -150,8 +150,8 @@ async def imdb_search_en(kueri, message):
msg = ""
buttons = InlineKeyboard(row_width=4)
try:
r = await http.get(f"{IMDB_API}/search?query={kueri}")
res = json.loads(r.text).get("results")
r = await http.get(f"{IMDB_API}?query={kueri}")
res = json.loads(r.json()).get("results")
if not res:
return await k.edit_caption(f"⛔️ Result not found for keywords: <code>{kueri}</code>")
msg += f"🎬 Found ({len(res)}) result for keywords: <code>{kueri}</code>\n\n"