From 990d7c5e86fd5993e34887ccf7a46f486d20f2a0 Mon Sep 17 00:00:00 2001 From: yasirarism <55983182+yasirarism@users.noreply.github.com> Date: Mon, 12 Dec 2022 13:44:34 +0700 Subject: [PATCH] Add pahe search scrape --- misskaty/plugins/scrapwebsite.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misskaty/plugins/scrapwebsite.py b/misskaty/plugins/scrapwebsite.py index 26b02ee4..fad339d1 100644 --- a/misskaty/plugins/scrapwebsite.py +++ b/misskaty/plugins/scrapwebsite.py @@ -172,17 +172,18 @@ async def melongmovie(_, message): @capture_err async def pahe_scrap(_, message): judul = message.text.split(" ", maxsplit=1)[1] if len(message.command) > 1 else "" - r = await http.get("https://yasirapi.eu.org/terbit21") + r = await http.get(f"https://yasirapi.eu.org/pahe?q={judul}") + pesan = await message.reply("Please wait, scraping data..") res = r.json() data = "".join(f"**{count}. {i['judul']}**\n{i['link']}\n\n" for count, i in enumerate(res["result"], start=1)) try: - return await message.reply( + await pesan.edit( f"**Daftar rilis movie terbaru di web Pahe**:\n{data}", disable_web_page_preview=True, ) except MessageTooLong: msg = await rentry(data) - return await message.reply(f"Karena hasil scrape terlalu panjang, maka hasil scrape di post ke rentry.\n\n{msg}") + await pesan.edit(f"Karena hasil scrape terlalu panjang, maka hasil scrape di post ke rentry.\n\n{msg}") @app.on_message(filters.command(["terbit21"], COMMAND_HANDLER))