mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-05 11:44:50 +00:00
Fix
This commit is contained in:
parent
ee6fd74c3f
commit
a6ef59ec4e
3 changed files with 13 additions and 10 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
from pyrogram.errors import ChatWriteForbidden, FloodWait, MessageNotModified, ChatAdminRequired, MessageDeleteForbidden, MessageIdInvalid
|
from pyrogram.errors import ChatWriteForbidden, FloodWait, MessageNotModified, ChatAdminRequired, MessageDeleteForbidden, MessageIdInvalid, MessageEmpty
|
||||||
|
|
||||||
LOGGER = getLogger(__name__)
|
LOGGER = getLogger(__name__)
|
||||||
|
|
||||||
|
|
@ -32,7 +32,7 @@ async def editPesan(msg, text, **kwargs):
|
||||||
LOGGER.warning(str(e))
|
LOGGER.warning(str(e))
|
||||||
await asyncio.sleep(e.value)
|
await asyncio.sleep(e.value)
|
||||||
return await editPesan(msg, text, **kwargs)
|
return await editPesan(msg, text, **kwargs)
|
||||||
except (MessageNotModified, MessageIdInvalid):
|
except (MessageNotModified, MessageIdInvalid, MessageEmpty):
|
||||||
return
|
return
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOGGER.error(str(e))
|
LOGGER.error(str(e))
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ async def inline_menu(_, inline_query: InlineQuery):
|
||||||
msg += f"<code>{i['name']}</code> (<b>{i['types'][0]}</b>)\n<b>Required:</b> <code>{i['required']}</code>\n{i['description']}\n\n"
|
msg += f"<code>{i['name']}</code> (<b>{i['types'][0]}</b>)\n<b>Required:</b> <code>{i['required']}</code>\n{i['description']}\n\n"
|
||||||
if len(msg.encode("utf-8")) > 4096:
|
if len(msg.encode("utf-8")) > 4096:
|
||||||
body_text = f"""
|
body_text = f"""
|
||||||
<pre>{msg}</pre>
|
<pre>{msg.replace("<user_id>", "(user_id)")}</pre>
|
||||||
"""
|
"""
|
||||||
msg = await post_to_telegraph(False, method, body_text)
|
msg = await post_to_telegraph(False, method, body_text)
|
||||||
datajson.append(
|
datajson.append(
|
||||||
|
|
|
||||||
|
|
@ -69,13 +69,16 @@ async def ytdownv2(_, message):
|
||||||
return await message.reply("Please input a valid YT-DLP Supported URL")
|
return await message.reply("Please input a valid YT-DLP Supported URL")
|
||||||
url = message.text.split(" ", maxsplit=1)[1]
|
url = message.text.split(" ", maxsplit=1)[1]
|
||||||
async with iYTDL(log_group_id=0, cache_path="cache", ffmpeg_location="/usr/bin/mediaextract") as ytdl:
|
async with iYTDL(log_group_id=0, cache_path="cache", ffmpeg_location="/usr/bin/mediaextract") as ytdl:
|
||||||
x = await ytdl.parse(url)
|
try:
|
||||||
if x is None:
|
x = await ytdl.parse(url)
|
||||||
return await message.reply("Failed parse URL, check logs..")
|
if x is None:
|
||||||
img = await get_ytthumb(x.key)
|
return await message.reply("Failed parse URL, check logs..")
|
||||||
caption = x.caption
|
img = await get_ytthumb(x.key)
|
||||||
markup = x.buttons
|
caption = x.caption
|
||||||
await message.reply_photo(img, caption=caption, reply_markup=markup, quote=True)
|
markup = x.buttons
|
||||||
|
await message.reply_photo(img, caption=caption, reply_markup=markup, quote=True)
|
||||||
|
except Exception as err:
|
||||||
|
await kirimPesan(message, str(err))
|
||||||
|
|
||||||
|
|
||||||
@app.on_callback_query(filters.regex(r"^yt_listall"))
|
@app.on_callback_query(filters.regex(r"^yt_listall"))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue