mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
Tes rewrite
This commit is contained in:
parent
48dc1acc57
commit
f5c48c4627
1 changed files with 0 additions and 224 deletions
|
|
@ -589,230 +589,6 @@ async def pahe_scrap(_, msg):
|
|||
await msg.reply(f"ERROR: {e}", True)
|
||||
|
||||
|
||||
@app.on_message(filters.command(["terbit21"], COMMAND_HANDLER))
|
||||
@capture_err
|
||||
async def terbit21_scrap(_, msg):
|
||||
m = await msg.reply("**__Checking data list ...__**", True)
|
||||
if len(msg.command) == 1:
|
||||
try:
|
||||
r = await http.get("https://yasirapi.eu.org/terbit21")
|
||||
res = r.json()
|
||||
if not res["result"]:
|
||||
await m.delete()
|
||||
return await msg.reply("404 Result not FOUND!", True)
|
||||
await m.delete()
|
||||
head = f"<b>#Terbit21 Latest:</b>\n🌀 Use /{msg.command[0]} [title] to start search with title.\n\n"
|
||||
msgs = ""
|
||||
for c, i in enumerate(res["result"], start=1):
|
||||
msgs += f"<b>{c}. <a href='{i['link']}'>{i['judul']}</a></b>\n<b>Category:</b> <code>{i['kategori']}</code>\n"
|
||||
msgs += "\n" if re.search(r"Complete|Ongoing", i["kategori"]) else f"💠 <b><a href='{i['dl']}'>Download</a></b>\n\n"
|
||||
if len(head.encode("utf-8") + msgs.encode("utf-8")) >= 4000:
|
||||
await msg.reply(
|
||||
head + msgs,
|
||||
True,
|
||||
disable_web_page_preview=True,
|
||||
reply_markup=InlineKeyboardMarkup(
|
||||
[
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="❌ Close",
|
||||
callback_data=f"close#{msg.from_user.id}",
|
||||
)
|
||||
]
|
||||
]
|
||||
),
|
||||
)
|
||||
await asyncio.sleep(2)
|
||||
msgs = ""
|
||||
if msgs != "":
|
||||
await msg.reply(
|
||||
head + msgs,
|
||||
True,
|
||||
disable_web_page_preview=True,
|
||||
reply_markup=InlineKeyboardMarkup(
|
||||
[
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="❌ Close",
|
||||
callback_data=f"close#{msg.from_user.id}",
|
||||
)
|
||||
]
|
||||
]
|
||||
),
|
||||
)
|
||||
except Exception as e:
|
||||
await m.delete()
|
||||
LOGGER.error(e)
|
||||
await msg.reply(str(e), True)
|
||||
else:
|
||||
try:
|
||||
title = msg.text.split(" ", 1)[1]
|
||||
r = await http.get(f"https://yasirapi.eu.org/terbit21?q={title}")
|
||||
res = r.json()
|
||||
if not res["result"]:
|
||||
await m.delete()
|
||||
return await msg.reply("404 Result not FOUND!", True)
|
||||
await m.delete()
|
||||
head = f"<b>#Terbit21 Results For:</b> <code>{title}</code>\n\n"
|
||||
msgs = ""
|
||||
for c, i in enumerate(res["result"], start=1):
|
||||
msgs += f"<b>{c}. <a href='{i['link']}'>{i['judul']}</a></b>\n<b>Category:</b> <code>{i['kategori']}</code>\n"
|
||||
msgs += "\n" if re.search(r"Complete|Ongoing", i["kategori"]) else f"💠 <b><a href='{i['dl']}'>Download</a></b>\n\n"
|
||||
if len(head.encode("utf-8") + msgs.encode("utf-8")) >= 4000:
|
||||
await msg.reply(
|
||||
head + msgs,
|
||||
True,
|
||||
disable_web_page_preview=True,
|
||||
reply_markup=InlineKeyboardMarkup(
|
||||
[
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="❌ Close",
|
||||
callback_data=f"close#{msg.from_user.id}",
|
||||
)
|
||||
]
|
||||
]
|
||||
),
|
||||
)
|
||||
await asyncio.sleep(2)
|
||||
msgs = ""
|
||||
if msgs != "":
|
||||
await msg.reply(
|
||||
head + msgs,
|
||||
True,
|
||||
disable_web_page_preview=True,
|
||||
reply_markup=InlineKeyboardMarkup(
|
||||
[
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="❌ Close",
|
||||
callback_data=f"close#{msg.from_user.id}",
|
||||
)
|
||||
]
|
||||
]
|
||||
),
|
||||
)
|
||||
except Exception as e:
|
||||
await m.delete()
|
||||
LOGGER.error(e)
|
||||
await msg.reply(str(e), True)
|
||||
|
||||
|
||||
@app.on_message(filters.command(["lk21"], COMMAND_HANDLER))
|
||||
@capture_err
|
||||
async def lk21_scrap(_, msg):
|
||||
m = await msg.reply("**__Checking data list ...__**", True)
|
||||
if len(msg.command) == 1:
|
||||
try:
|
||||
r = await http.get("https://yasirapi.eu.org/lk21")
|
||||
res = r.json()
|
||||
if res.get("detail", None):
|
||||
await m.delete()
|
||||
return await msg.reply(f"ERROR: {res['detail']}", True)
|
||||
if not res["result"]:
|
||||
await m.delete()
|
||||
return await msg.reply("404 Result not FOUND!", True)
|
||||
await m.delete()
|
||||
head = f"<b>#Layarkaca21 Latest:</b>\n🌀 Use /{msg.command[0]} [title] to start search with title.\n\n"
|
||||
msgs = ""
|
||||
for c, i in enumerate(res["result"], start=1):
|
||||
msgs += f"<b>{c}. <a href='{i['link']}'>{i['judul']}</a></b>\n<b>Category:</b> <code>{i['kategori']}</code>\n"
|
||||
msgs += "\n" if re.search(r"Complete|Ongoing", i["kategori"]) else f"💠 <b><a href='{i['dl']}'>Download</a></b>\n\n"
|
||||
if len(head.encode("utf-8") + msgs.encode("utf-8")) >= 4000:
|
||||
await msg.reply(
|
||||
head + msgs,
|
||||
True,
|
||||
disable_web_page_preview=True,
|
||||
reply_markup=InlineKeyboardMarkup(
|
||||
[
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="❌ Close",
|
||||
callback_data=f"close#{msg.from_user.id}",
|
||||
)
|
||||
]
|
||||
]
|
||||
),
|
||||
)
|
||||
await asyncio.sleep(2)
|
||||
msgs = ""
|
||||
if msgs != "":
|
||||
await msg.reply(
|
||||
head + msgs,
|
||||
True,
|
||||
disable_web_page_preview=True,
|
||||
reply_markup=InlineKeyboardMarkup(
|
||||
[
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="❌ Close",
|
||||
callback_data=f"close#{msg.from_user.id}",
|
||||
)
|
||||
]
|
||||
]
|
||||
),
|
||||
)
|
||||
except Exception as e:
|
||||
await m.delete()
|
||||
LOGGER.error(e)
|
||||
await msg.reply(str(e), True)
|
||||
else:
|
||||
try:
|
||||
title = msg.text.split(" ", 1)[1]
|
||||
r = await http.get(f"https://yasirapi.eu.org/lk21?q={title}")
|
||||
res = r.json()
|
||||
if res.get("detail", None):
|
||||
await m.delete()
|
||||
return await msg.reply(f"ERROR: {res['detail']}", True)
|
||||
if not res["result"]:
|
||||
await m.delete()
|
||||
return await msg.reply("404 Result not FOUND!", True)
|
||||
await m.delete()
|
||||
head = f"<b>#Layarkaca21 Results For:</b> <code>{title}</code>\n\n"
|
||||
msgs = ""
|
||||
for c, i in enumerate(res["result"], start=1):
|
||||
msgs += f"<b>{c}. <a href='{i['link']}'>{i['judul']}</a></b>\n<b>Category:</b> <code>{i['kategori']}</code>\n"
|
||||
msgs += "\n" if re.search(r"Complete|Ongoing", i["kategori"]) else f"💠 <b><a href='{i['dl']}'>Download</a></b>\n\n"
|
||||
if len(head.encode("utf-8") + msgs.encode("utf-8")) >= 4000:
|
||||
await msg.reply(
|
||||
head + msgs,
|
||||
True,
|
||||
disable_web_page_preview=True,
|
||||
reply_markup=InlineKeyboardMarkup(
|
||||
[
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="❌ Close",
|
||||
callback_data=f"close#{msg.from_user.id}",
|
||||
)
|
||||
]
|
||||
]
|
||||
),
|
||||
)
|
||||
await asyncio.sleep(2)
|
||||
msgs = ""
|
||||
if msgs != "":
|
||||
await msg.reply(
|
||||
head + msgs,
|
||||
True,
|
||||
disable_web_page_preview=True,
|
||||
reply_markup=InlineKeyboardMarkup(
|
||||
[
|
||||
[
|
||||
InlineKeyboardButton(
|
||||
text="❌ Close",
|
||||
callback_data=f"close#{msg.from_user.id}",
|
||||
)
|
||||
]
|
||||
]
|
||||
),
|
||||
)
|
||||
except Exception as e:
|
||||
await m.delete()
|
||||
LOGGER.error(e)
|
||||
await msg.reply(str(e), True)
|
||||
|
||||
|
||||
@app.on_message(filters.command(["gomov"], COMMAND_HANDLER))
|
||||
@capture_err
|
||||
async def gomov_scrap(_, msg):
|
||||
|
|
|
|||
Loading…
Reference in a new issue