Skip to content

Commit

Permalink
current file no indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
yashoswalyo committed Nov 7, 2022
1 parent 1900ab8 commit 7d0752f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 5 additions & 3 deletions plugins/mergeVideo.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ async def mergeNow(c: Client, cb: CallbackQuery, new_file_name: str):
if not os.path.exists(f"downloads/{str(cb.from_user.id)}/"):
os.makedirs(f"downloads/{str(cb.from_user.id)}/")
input_ = f"downloads/{str(cb.from_user.id)}/input.txt"
all = len(list_message_ids)
n=1
for i in await c.get_messages(
chat_id=cb.from_user.id, message_ids=list_message_ids
):
chat_id=cb.from_user.id, message_ids=list_message_ids ):
media = i.video or i.document
await cb.message.edit(f"📥 Starting Download of ... `{media.file_name}`")
LOGGER.info(f"📥 Starting Download of ... {media.file_name}")
Expand All @@ -57,8 +58,9 @@ async def mergeNow(c: Client, cb: CallbackQuery, new_file_name: str):
message=media,
file_name=f"downloads/{str(cb.from_user.id)}/{str(i.id)}/vid.mkv", # fix for filename with single quote(') in name
progress=prog.progress_for_pyrogram,
progress_args=(f"🚀 Downloading: `{media.file_name}`", c_time),
progress_args=(f"🚀 Downloading: `{media.file_name}`", c_time, f"\n**Downloading: {n}/{all}**"),
)
n+=1
if gDict[cb.message.chat.id] and cb.message.id in gDict[cb.message.chat.id]:
return
await cb.message.edit(f"Downloaded Sucessfully ... `{media.file_name}`")
Expand Down
5 changes: 4 additions & 1 deletion plugins/mergeVideoAudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ async def mergeAudio(c: Client, cb: CallbackQuery, new_file_name: str):
return
if not os.path.exists(f"downloads/{str(cb.from_user.id)}/"):
os.makedirs(f"downloads/{str(cb.from_user.id)}/")
all = len(list_message_ids)
n=1
msgs: list[Message] = await c.get_messages(
chat_id=cb.from_user.id, message_ids=list_message_ids
)
Expand All @@ -54,8 +56,9 @@ async def mergeAudio(c: Client, cb: CallbackQuery, new_file_name: str):
message=media,
file_name=f"downloads/{str(cb.from_user.id)}/{str(i.id)}/{tmpFileName}",
progress=prog.progress_for_pyrogram,
progress_args=(f"🚀 Downloading: `{media.file_name}`", c_time),
progress_args=(f"🚀 Downloading: `{media.file_name}`", c_time, f"\n**Downloading: {n}/{all}**"),
)
n+=1
if gDict[cb.message.chat.id] and cb.message.id in gDict[cb.message.chat.id]:
return
await cb.message.edit(f"Downloaded Sucessfully ... `{media.file_name}`")
Expand Down
5 changes: 4 additions & 1 deletion plugins/mergeVideoSub.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ async def mergeSub(c: Client, cb: CallbackQuery, new_file_name: str):
msgs: list[Message] = await c.get_messages(
chat_id=cb.from_user.id, message_ids=list_message_ids
)
all = len(msgs)
n=1
for i in msgs:
media = i.video or i.document
await cb.message.edit(f"📥 Starting Download of ... `{media.file_name}`")
Expand All @@ -65,8 +67,9 @@ async def mergeSub(c: Client, cb: CallbackQuery, new_file_name: str):
message=media,
file_name=f"downloads/{str(cb.from_user.id)}/{str(i.id)}/{tmpFileName}",
progress=prog.progress_for_pyrogram,
progress_args=(f"🚀 Downloading: `{media.file_name}`", c_time),
progress_args=(f"🚀 Downloading: `{media.file_name}`", c_time,f"\n**Downloading: {n}/{all}**"),
)
n+=1
if gDict[cb.message.chat.id] and cb.message.id in gDict[cb.message.chat.id]:
return
await cb.message.edit(f"Downloaded Sucessfully ... `{media.file_name}`")
Expand Down

0 comments on commit 7d0752f

Please sign in to comment.