mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
catch err
This commit is contained in:
parent
d4753fe5bc
commit
b1b10ba246
2 changed files with 9 additions and 7 deletions
|
|
@ -6,9 +6,6 @@ from pyrogram.errors import FloodWait
|
||||||
from pyrogram.types import InputMediaPhoto
|
from pyrogram.types import InputMediaPhoto
|
||||||
|
|
||||||
from misskaty.plugins.dev import shell_exec
|
from misskaty.plugins.dev import shell_exec
|
||||||
from logging import getLogger
|
|
||||||
|
|
||||||
LOGGER = getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
def hhmmss(seconds):
|
def hhmmss(seconds):
|
||||||
|
|
@ -18,8 +15,7 @@ def hhmmss(seconds):
|
||||||
async def take_ss(video_file):
|
async def take_ss(video_file):
|
||||||
out_put_file_name = f"genss-{str(time.time())}.png"
|
out_put_file_name = f"genss-{str(time.time())}.png"
|
||||||
cmd = f"""vcsi "{video_file}" -t -w 1340 -g 4x4 --timestamp-font assets/DejaVuSans.ttf --metadata-font assets/DejaVuSans-Bold.ttf --template misskaty/helper/ssgen_template.html --quality 100 --end-delay-percent 20 --metadata-font-size 30 -o {out_put_file_name} --timestamp-font-size 20"""
|
cmd = f"""vcsi "{video_file}" -t -w 1340 -g 4x4 --timestamp-font assets/DejaVuSans.ttf --metadata-font assets/DejaVuSans-Bold.ttf --template misskaty/helper/ssgen_template.html --quality 100 --end-delay-percent 20 --metadata-font-size 30 -o {out_put_file_name} --timestamp-font-size 20"""
|
||||||
r = await shell_exec(cmd)
|
await shell_exec(cmd)
|
||||||
LOGGER.info(r)
|
|
||||||
return out_put_file_name if os.path.lexists(out_put_file_name) else None
|
return out_put_file_name if os.path.lexists(out_put_file_name) else None
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -253,9 +253,15 @@ async def generate_session(bot, msg, telethon=False, is_bot: bool = False):
|
||||||
reply_markup=InlineKeyboardMarkup(gen_button),
|
reply_markup=InlineKeyboardMarkup(gen_button),
|
||||||
)
|
)
|
||||||
elif telethon:
|
elif telethon:
|
||||||
|
try:
|
||||||
await client.start(bot_token=phone_number)
|
await client.start(bot_token=phone_number)
|
||||||
|
except Exception as err:
|
||||||
|
return await msg.reply(err)
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
await client.sign_in_bot(phone_number)
|
await client.sign_in_bot(phone_number)
|
||||||
|
except Exception as err:
|
||||||
|
return await msg.reply(err)
|
||||||
if telethon:
|
if telethon:
|
||||||
string_session = client.session.save()
|
string_session = client.session.save()
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue