This commit is contained in:
yasir 2023-01-06 10:25:36 +07:00
parent 8bda4f98d9
commit 27ec6138e5
2 changed files with 19 additions and 5 deletions

View file

@ -0,0 +1,16 @@
import asyncio
from logging import getLogger
LOGGER = getLogger(__name__)
async def kirimPesan(msg, text: str, reply_markup=None):
try:
return await msg.reply(text, disable_web_page_preview=True)
except FloodWait as e:
LOGGER.warning(str(e))
await asyncio.sleep(e.value)
return await kirimPesan(text)
except Exception as e:
LOGGER.error(str(e))
return

View file

@ -52,7 +52,7 @@ async def nodrakor(_, msg):
if "Nothing Found" in entry[0].text:
await m.delete()
if title != "":
await msg.reply(f"404 Not FOUND For: {key}", True)
await msg.reply(f"404 Not FOUND For: {title}", True)
else:
await msg.reply(f"404 Not FOUND!", True)
return
@ -97,9 +97,7 @@ async def ngefilm21(_, message):
msg = await message.reply("Sedang proses scrap, mohon tunggu..")
try:
html = await http.get(
f"https://ngefilm.info/search?q={title}", headers=headers
)
html = await http.get(f"https://ngefilm.info/search?q={title}", headers=headers)
soup = BeautifulSoup(html.text, "lxml")
res = soup.find_all("h2")
data = []
@ -507,7 +505,7 @@ async def gomov_scrap(_, msg):
if "Nothing Found" in entry[0].text:
await m.delete()
if title != "":
await msg.reply(f"404 Not FOUND For: {key}", True)
await msg.reply(f"404 Not FOUND For: {title}", True)
else:
await msg.reply(f"404 Not FOUND!", True)
return