mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
okk
This commit is contained in:
parent
0cd960bc1b
commit
9355c09a5f
2 changed files with 14 additions and 16 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
# skipcq
|
|
||||||
from .callback import callback
|
from .callback import callback
|
||||||
from .command import command
|
from .command import command
|
||||||
|
|
||||||
|
__all__ = ["callback", "command"]
|
||||||
|
|
@ -61,6 +61,17 @@ def remove_html_tags(text):
|
||||||
return re.sub(clean, "", text)
|
return re.sub(clean, "", text)
|
||||||
|
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edge/107.0.1418.42"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async def get_content(url):
|
||||||
|
async with aiohttp.ClientSession() as session:
|
||||||
|
r = await session.get(url, headers=headers)
|
||||||
|
return await r.read()
|
||||||
|
|
||||||
|
|
||||||
@app.on_cmd("kbbi")
|
@app.on_cmd("kbbi")
|
||||||
async def kbbi_search(_, ctx: Client):
|
async def kbbi_search(_, ctx: Client):
|
||||||
if len(ctx.command) == 1:
|
if len(ctx.command) == 1:
|
||||||
|
|
@ -190,9 +201,6 @@ async def gsearch(client, message):
|
||||||
query = message.text.split(" ", maxsplit=1)[1]
|
query = message.text.split(" ", maxsplit=1)[1]
|
||||||
msg = await message.reply_text(f"**Googling** for `{query}` ...")
|
msg = await message.reply_text(f"**Googling** for `{query}` ...")
|
||||||
try:
|
try:
|
||||||
headers = {
|
|
||||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edge/107.0.1418.42"
|
|
||||||
}
|
|
||||||
html = await http.get(
|
html = await http.get(
|
||||||
f"https://www.google.com/search?q={query}&gl=id&hl=id&num=17",
|
f"https://www.google.com/search?q={query}&gl=id&hl=id&num=17",
|
||||||
headers=headers,
|
headers=headers,
|
||||||
|
|
@ -270,7 +278,7 @@ async def translate(client, message):
|
||||||
@app.on_message(filters.command(["tts"], COMMAND_HANDLER))
|
@app.on_message(filters.command(["tts"], COMMAND_HANDLER))
|
||||||
@capture_err
|
@capture_err
|
||||||
@ratelimiter
|
@ratelimiter
|
||||||
async def tts(_, message):
|
async def tts_convert(_, message):
|
||||||
if message.reply_to_message and (
|
if message.reply_to_message and (
|
||||||
message.reply_to_message.text or message.reply_to_message.caption
|
message.reply_to_message.text or message.reply_to_message.caption
|
||||||
):
|
):
|
||||||
|
|
@ -475,17 +483,6 @@ async def close_callback(bot: Client, query: CallbackQuery):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
headers = {
|
|
||||||
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/600.1.17 (KHTML, like Gecko) Version/7.1 Safari/537.85.10"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
async def get_content(url):
|
|
||||||
async with aiohttp.ClientSession() as session:
|
|
||||||
r = await session.get(url, headers=headers)
|
|
||||||
return await r.read()
|
|
||||||
|
|
||||||
|
|
||||||
async def mdlapi(title):
|
async def mdlapi(title):
|
||||||
link = f"https://kuryana.vercel.app/search/q/{title}"
|
link = f"https://kuryana.vercel.app/search/q/{title}"
|
||||||
async with aiohttp.ClientSession() as ses, ses.get(link) as result:
|
async with aiohttp.ClientSession() as ses, ses.get(link) as result:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue