From 6011229bcf0d560ceabbfc4e9e5d1f652ae8c1be Mon Sep 17 00:00:00 2001 From: yasirarism <55983182+yasirarism@users.noreply.github.com> Date: Wed, 7 Dec 2022 12:23:21 +0700 Subject: [PATCH] Update scrapwebsite.py --- misskaty/plugins/scrapwebsite.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/misskaty/plugins/scrapwebsite.py b/misskaty/plugins/scrapwebsite.py index 5357cd21..85c4b409 100644 --- a/misskaty/plugins/scrapwebsite.py +++ b/misskaty/plugins/scrapwebsite.py @@ -125,9 +125,10 @@ async def movikucc(_, message): @app.on_message(filters.command(["savefilm21"], COMMAND_HANDLER)) @capture_err async def savefilm21(_, message): - if len(message.command) == 1: - return await message.reply("Masukkan query yang akan dicari..!!") - judul = message.text.split(" ", maxsplit=1)[1] + try: + judul = message.text.split(" ", maxsplit=1)[1] + except IndexError: + judul = "" msg = await message.reply("Sedang proses scrap, mohon tunggu..") try: headers = { @@ -135,7 +136,7 @@ async def savefilm21(_, message): } html = await http.get( - f"http://38.242.196.210/?s={judul}", headers=headers, follow_redirects=False + f"http://185.99.135.215/?s={judul}", headers=headers, follow_redirects=False ) soup = BeautifulSoup(html.text, "lxml") res = soup.find_all(class_="entry-title")