Skip to content

Commit

Permalink
pyro v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrvishal2k2 authored Jul 3, 2022
1 parent 908c221 commit 55d7675
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions root/utils/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async def uploader(bot,file, update, msg,as_file=False):
await bot.send_document(
document=file,
chat_id=update.chat.id,
reply_to_message_id=update.message_id,
reply_to_message_id=update.id,
disable_notification=True,
force_document=True,
thumb=thumb_image_path,
Expand All @@ -53,6 +53,7 @@ async def uploader(bot,file, update, msg,as_file=False):
except FloodWait as e:
logger.info(f"Got Flood Wait of {e.x} second me sleeping now...")
await asyncio.sleep(e.x)
return await uploader(bot,file, update, msg,as_file)
except Exception as er:
logger.info(str(er))
if thumb_image_path is not None:
Expand Down Expand Up @@ -90,20 +91,20 @@ async def uploader(bot,file, update, msg,as_file=False):
# upload video..
try:
await update.reply_video(
video=file,
quote=True,
duration=duration,
width=width,
height=height,
thumb=thumb_image_path,
disable_notification=True,
caption=filename,
supports_streaming=True,
progress=progress_for_pyrogram,
progress_args=(
Translation.UPLOAD_MSG,
msg,
start_time
video=file,
quote=True,
duration=duration,
width=width,
height=height,
thumb=thumb_image_path,
disable_notification=True,
caption=filename,
supports_streaming=True,
progress=progress_for_pyrogram,
progress_args=(
Translation.UPLOAD_MSG,
msg,
start_time
))
except FloodWait as e:
logger.info(f"Got Flood wait of {e.x} seconds ")
Expand Down

0 comments on commit 55d7675

Please sign in to comment.