ariaTools: Add a function to get file name of download
This commit is contained in:
parent
6bb1224aa7
commit
ffd1f7f378
|
|
@ -5,4 +5,5 @@ config.ini
|
|||
*.pyc
|
||||
downloads/*
|
||||
download/*
|
||||
data*
|
||||
data*
|
||||
.vscode
|
||||
|
|
@ -46,6 +46,9 @@ def remove_download(message):
|
|||
return True
|
||||
|
||||
|
||||
def get_file_name(download):
|
||||
file = aria2.get_download(download.gid)
|
||||
return file.name
|
||||
|
||||
def get_download_by_message(message):
|
||||
if allDls[message] == None:
|
||||
|
|
@ -88,4 +91,3 @@ def progress_status(context,update,previous):
|
|||
LOGGER.info(file.name+" Completed.")
|
||||
msg = "<i>"+str(file.name) +"</i>:- Uploading."
|
||||
context.bot.edit_message_text(text=msg,message_id=update.message_id,chat_id=update.chat.id,parse_mode='HTMl')
|
||||
return file.name
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ def mirror(update,context):
|
|||
link = message.replace('/mirror','')[1:]
|
||||
reply_msg = context.bot.send_message(chat_id=update.message.chat_id, reply_to_message_id=update.message.message_id, text="Starting Download")
|
||||
download = ariaTools.add_download(link,[reply_msg,update])
|
||||
file_name = ariaTools.progress_status(context,reply_msg,previous=None)
|
||||
ariaTools.progress_status(context,reply_msg,previous=None)
|
||||
file_name = ariaTools.get_file_name(download)
|
||||
LOGGER.info("File-Name: "+file_name)
|
||||
try:
|
||||
link = gdriveTools.upload(file_name)
|
||||
|
|
|
|||
Loading…
Reference in New Issue