Fix scraper

This commit is contained in:
Yasir Aris M 2024-09-24 07:34:25 +07:00 committed by GitHub
parent 365f1b9eec
commit 5a4c5f1a3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,7 +16,7 @@ import httpx
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from cachetools import TTLCache from cachetools import TTLCache
from pykeyboard import InlineButton, InlineKeyboard from pykeyboard import InlineButton, InlineKeyboard
from pyrogram.errors import QueryIdInvalid from pyrogram.errors import MessageTooLong, QueryIdInvalid
from pyrogram.types import Message from pyrogram.types import Message
from database import dbname from database import dbname
@ -1463,7 +1463,10 @@ async def muviku_scrap(_, message, strings):
res = "".join( res = "".join(
f"<b>Host: {i['kualitas']}</b>\n{i['link']}\n\n" for i in data f"<b>Host: {i['kualitas']}</b>\n{i['link']}\n\n" for i in data
) )
await message.reply(res) await message.reply_msg(res)
except MessageTooLong:
url = await post_to_telegraph(False, link, res)
await message.reply_msg(f"Your result is too long, i have pasted your result on Telegraph:\n{url}")
except IndexError: except IndexError:
return await message.reply( return await message.reply(
strings("invalid_cmd_scrape").format(cmd=message.command[0]) strings("invalid_cmd_scrape").format(cmd=message.command[0])