diff --git a/.gitignore b/.gitignore index fb55e72..0895daf 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ config.ini *.pyc downloads/* download/* -data* \ No newline at end of file +data* +.vscode \ No newline at end of file diff --git a/aria.sh b/aria.sh old mode 100644 new mode 100755 diff --git a/bot/helper/ariaTools.py b/bot/helper/ariaTools.py index 0209c64..e5943ff 100644 --- a/bot/helper/ariaTools.py +++ b/bot/helper/ariaTools.py @@ -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 = ""+str(file.name) +":- Uploading." context.bot.edit_message_text(text=msg,message_id=update.message_id,chat_id=update.chat.id,parse_mode='HTMl') - return file.name diff --git a/bot/mirror.py b/bot/mirror.py index 3c76770..20942c2 100644 --- a/bot/mirror.py +++ b/bot/mirror.py @@ -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)