Update inline_search.py

Signed-off-by: Yasir Aris M <git@yasir.id>
This commit is contained in:
Yasir Aris M 2025-02-14 22:25:39 +07:00 committed by GitHub
parent 596dc4b452
commit 1fe11db2e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,7 +11,6 @@ from sys import platform
from sys import version as pyver from sys import version as pyver
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from deep_translator import GoogleTranslator
from pykeyboard import InlineButton, InlineKeyboard from pykeyboard import InlineButton, InlineKeyboard
from pyrogram import __version__ as pyrover from pyrogram import __version__ as pyrover
from pyrogram import enums, filters from pyrogram import enums, filters
@ -26,7 +25,7 @@ from pyrogram.types import (
) )
from misskaty import BOT_USERNAME, app, user from misskaty import BOT_USERNAME, app, user
from misskaty.helper import GENRES_EMOJI, fetch, post_to_telegraph, search_jw from misskaty.helper import GENRES_EMOJI, fetch, gtranslate, post_to_telegraph, search_jw
from misskaty.plugins.dev import shell_exec from misskaty.plugins.dev import shell_exec
from misskaty.plugins.misc_tools import calc_btn from misskaty.plugins.misc_tools import calc_btn
from misskaty.vars import USER_SESSION from misskaty.vars import USER_SESSION
@ -662,7 +661,7 @@ async def imdb_inl(_, query):
.find(class_="ipc-metadata-list-item__content-container") .find(class_="ipc-metadata-list-item__content-container")
.text .text
) )
res_str += f"<b>Durasi:</b> <code>{GoogleTranslator('auto', 'id').translate(durasi)}</code>\n" res_str += f"<b>Durasi:</b> <code>{(await gtranslate(durasi, 'auto', 'id')).text}</code>\n"
if r_json.get("contentRating"): if r_json.get("contentRating"):
res_str += f"<b>Kategori:</b> <code>{r_json['contentRating']}</code> \n" res_str += f"<b>Kategori:</b> <code>{r_json['contentRating']}</code> \n"
if r_json.get("aggregateRating"): if r_json.get("aggregateRating"):
@ -723,9 +722,7 @@ async def imdb_inl(_, query):
) )
res_str += f"<b>Pemeran:</b> {actors[:-2]}\n\n" res_str += f"<b>Pemeran:</b> {actors[:-2]}\n\n"
if r_json.get("description"): if r_json.get("description"):
summary = GoogleTranslator("auto", "id").translate( summary = (await gtranslate(r_json.get("description"), "auto", "id")).text
r_json.get("description")
)
res_str += f"<b>📜 Plot:</b>\n<blockquote><code>{summary}</code></blockquote>\n\n" res_str += f"<b>📜 Plot:</b>\n<blockquote><code>{summary}</code></blockquote>\n\n"
if r_json.get("keywords"): if r_json.get("keywords"):
key_ = "".join( key_ = "".join(
@ -741,7 +738,7 @@ async def imdb_inl(_, query):
.find(class_="ipc-metadata-list-item__list-content-item") .find(class_="ipc-metadata-list-item__list-content-item")
.text .text
) )
res_str += f"<b>🏆 Penghargaan:</b>\n<blockquote><code>{GoogleTranslator('auto', 'id').translate(awards)}</code></blockquote>\n" res_str += f"<b>🏆 Penghargaan:</b>\n<blockquote><code>{(await gtranslate(awards, 'auto', 'id')).text}</code></blockquote>\n"
else: else:
res_str += "\n" res_str += "\n"
if ott != "": if ott != "":