From d28ae9cc4101284b11f8bda22daff2f512d1884a Mon Sep 17 00:00:00 2001 From: Levi <57452819+l3v11@users.noreply.github.com> Date: Tue, 13 Sep 2022 21:09:20 +0600 Subject: [PATCH] Fix bot getting stuck while cloning folders - This fixes an issue where the bot was getting stuck when authorizing with token.json file while cloning folders having 20+ files - Rename compress module to archive module - Change the compression data command of archive module from /archive to /compress - Tidy up --- README.md | 7 ++- bot/__init__.py | 8 +-- bot/__main__.py | 4 +- bot/helper/download_utils/gd_downloader.py | 8 +-- bot/helper/drive_utils/gdriveTools.py | 19 +++---- bot/helper/ext_utils/bot_utils.py | 2 +- bot/helper/ext_utils/exceptions.py | 2 +- bot/helper/ext_utils/fs_utils.py | 6 +- .../{archive_status.py => compress_status.py} | 8 +-- bot/helper/status_utils/extract_status.py | 2 +- bot/helper/telegram_helper/bot_commands.py | 2 +- bot/helper/telegram_helper/message_utils.py | 24 ++++---- bot/modules/{compress.py => archive.py} | 56 +++++++++---------- bot/modules/auth.py | 12 ++-- bot/modules/clone.py | 6 +- bot/modules/list.py | 4 +- config_sample.env | 2 +- 17 files changed, 86 insertions(+), 86 deletions(-) rename bot/helper/status_utils/{archive_status.py => compress_status.py} (88%) rename bot/modules/{compress.py => archive.py} (86%) diff --git a/README.md b/README.md index ef6b25ab..7c595b20 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,13 @@ SearchX is a multipurpose Telegram bot written in Python for Google Drive - Search data in Google Drive - Clone data from Google Drive, AppDrive and GDToT -- Archive data from Google Drive, AppDrive and GDToT +- Compress data from Google Drive, AppDrive and GDToT - Extract data from Google Drive, AppDrive and GDToT - Count data from Google Drive - Delete data from Google Drive - Set data permission in Google Drive -- Size Limit support for Clone, Archive and Extraction tasks +- Size Limit support for Clone, Compression and Extraction tasks +- Destination change support for Clone tasks - MongoDB support for storing the list of authorized users - Index Link support - Multi-token telegraph support @@ -54,7 +55,7 @@ This list of commands is supported by the bot start - Start the bot find - Search data in Google Drive clone - Clone data to Google Drive -archive - Archive data to Google Drive +compress - Compress data to Google Drive extract - Extract data to Google Drive count - Count data from Google Drive cancel - Cancel a task diff --git a/bot/__init__.py b/bot/__init__.py index b566a488..bbf12f8b 100644 --- a/bot/__init__.py +++ b/bot/__init__.py @@ -151,12 +151,12 @@ def get_config(name: str): CLONE_LIMIT = None try: - COMPRESS_LIMIT = get_config('COMPRESS_LIMIT') - if len(COMPRESS_LIMIT) == 0: + ARCHIVE_LIMIT = get_config('ARCHIVE_LIMIT') + if len(ARCHIVE_LIMIT) == 0: raise KeyError - COMPRESS_LIMIT = float(COMPRESS_LIMIT) + ARCHIVE_LIMIT = float(ARCHIVE_LIMIT) except: - COMPRESS_LIMIT = None + ARCHIVE_LIMIT = None try: TOKEN_JSON_URL = get_config('TOKEN_JSON_URL') diff --git a/bot/__main__.py b/bot/__main__.py index f7c83a8e..002d17a5 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -7,7 +7,7 @@ from telegram.ext import CommandHandler from bot import bot, LOGGER, botStartTime, AUTHORIZED_CHATS, TELEGRAPH, Interval, dispatcher, updater -from bot.modules import auth, cancel, clone, compress, count, delete, eval, list, permission, shell, status +from bot.modules import archive, auth, cancel, clone, count, delete, eval, list, permission, shell, status from bot.helper.ext_utils.bot_utils import get_readable_file_size, get_readable_time from bot.helper.ext_utils.fs_utils import start_cleanup, clean_all, exit_clean_up from bot.helper.telegram_helper.bot_commands import BotCommands @@ -72,7 +72,7 @@ def restart(update, context):

/{BotCommands.CloneCommand} <url> <dest_id>: Clone data from Google Drive, AppDrive and GDToT (Destination ID optional)

-• /{BotCommands.ArchiveCommand} <url>: Archive data from Google Drive, AppDrive and GDToT +• /{BotCommands.CompressCommand} <url>: Compress data from Google Drive, AppDrive and GDToT

/{BotCommands.ExtractCommand} <url>: Extract data from Google Drive, AppDrive and GDToT

diff --git a/bot/helper/download_utils/gd_downloader.py b/bot/helper/download_utils/gd_downloader.py index 567013f3..a4eab4d0 100644 --- a/bot/helper/download_utils/gd_downloader.py +++ b/bot/helper/download_utils/gd_downloader.py @@ -1,7 +1,7 @@ import random import string -from bot import LOGGER, COMPRESS_LIMIT, download_dict, download_dict_lock +from bot import LOGGER, ARCHIVE_LIMIT, download_dict, download_dict_lock from bot.helper.drive_utils.gdriveTools import GoogleDriveHelper from bot.helper.status_utils.download_status import DownloadStatus from bot.helper.telegram_helper.message_utils import sendMessage, deleteMessage, sendStatusMessage @@ -17,11 +17,11 @@ def add_gd_download(link, path, listener, customname, is_appdrive, appdict, is_g return sendMessage(res, listener.bot, listener.message) if customname: name = customname - if COMPRESS_LIMIT is not None: - if size > COMPRESS_LIMIT * 1024**3: + if ARCHIVE_LIMIT is not None: + if size > ARCHIVE_LIMIT * 1024**3: msg2 = f"Name: {name}" msg2 += f"\nSize: {get_readable_file_size(size)}" - msg2 += f"\nLimit: {COMPRESS_LIMIT} GB" + msg2 += f"\nLimit: {ARCHIVE_LIMIT} GB" msg2 += "\n\n⚠️ Task failed" return sendMessage(msg2, listener.bot, listener.message) LOGGER.info(f"Downloading: {name}") diff --git a/bot/helper/drive_utils/gdriveTools.py b/bot/helper/drive_utils/gdriveTools.py index 0d115043..f639df97 100644 --- a/bot/helper/drive_utils/gdriveTools.py +++ b/bot/helper/drive_utils/gdriveTools.py @@ -432,7 +432,7 @@ def clone(self, link, dest_id): token_service = self.__alt_authorize() if token_service is not None: self.__service = token_service - return self.clone(link, key) + return self.clone(link, dest_id) msg = "File not found" else: msg = err @@ -591,7 +591,7 @@ def upload(self, file_name: str): if isinstance(err, RetryError): LOGGER.info(f"Total attempts: {err.last_attempt.attempt_number}") err = err.last_attempt.exception() - self.__listener.onUploadError(str(err)) + self.__listener.onUploadError(err) self.__is_errored = True finally: self.__updater.cancel() @@ -724,9 +724,9 @@ def __create_page(self, acc, content): author_name="Levi", author_url="https://t.me/l3v11", html_content=content)['path']) - except RetryAfterError as e: - LOGGER.info(f"Cooldown: {e.retry_after} seconds") - time.sleep(e.retry_after) + except RetryAfterError as err: + LOGGER.info(f"Cooldown: {err.retry_after} seconds") + time.sleep(err.retry_after) self.__create_page(acc, content) def __edit_page(self, acc, content, path): @@ -737,13 +737,12 @@ def __edit_page(self, acc, content, path): author_name="Levi", author_url="https://t.me/l3v11", html_content=content) - except RetryAfterError as e: - LOGGER.info(f"Cooldown: {e.retry_after} seconds") - time.sleep(e.retry_after) + except RetryAfterError as err: + LOGGER.info(f"Cooldown: {err.retry_after} seconds") + time.sleep(err.retry_after) self.__edit_page(acc, content, path) def __receive_callback(self, request_id, response, exception): - # request_id = order number of request = shared drive index (1 based) if exception is not None: exception = str(exception).replace('>', '').replace('<', '') LOGGER.error(exception) @@ -809,7 +808,7 @@ def drive_list(self, file_name): msg = f'

Query: {file_name}


' add_title_msg = False msg += f"╾────────────╼
{DRIVE_NAMES[index]}
╾────────────╼
" - # Detect whether the current entity is a folder or file + # Detect whether the current entity is a folder or a file for file in self.response[files]["files"]: if file.get('mimeType') == self.__G_DRIVE_DIR_MIME_TYPE: msg += f"🗂️{file.get('name')} (folder)
" \ diff --git a/bot/helper/ext_utils/bot_utils.py b/bot/helper/ext_utils/bot_utils.py index d0dfe9c1..06234e6d 100644 --- a/bot/helper/ext_utils/bot_utils.py +++ b/bot/helper/ext_utils/bot_utils.py @@ -16,7 +16,7 @@ class TaskStatus: STATUS_CLONING = "Cloning" STATUS_DOWNLOADING = "Downloading" STATUS_UPLOADING = "Uploading" - STATUS_ARCHIVING = "Archiving" + STATUS_COMPRESSING = "Compressing" STATUS_EXTRACTING = "Extracting" class SetInterval: diff --git a/bot/helper/ext_utils/exceptions.py b/bot/helper/ext_utils/exceptions.py index 30972967..b5e9a0ec 100644 --- a/bot/helper/ext_utils/exceptions.py +++ b/bot/helper/ext_utils/exceptions.py @@ -1,4 +1,4 @@ -class CompressExceptionHandler(Exception): +class ArchiveExceptionHandler(Exception): pass class DDLExceptionHandler(Exception): diff --git a/bot/helper/ext_utils/fs_utils.py b/bot/helper/ext_utils/fs_utils.py index fe290af7..ea3bff4f 100644 --- a/bot/helper/ext_utils/fs_utils.py +++ b/bot/helper/ext_utils/fs_utils.py @@ -5,7 +5,7 @@ import sys from bot import LOGGER, DOWNLOAD_DIR -from bot.helper.ext_utils.exceptions import CompressExceptionHandler +from bot.helper.ext_utils.exceptions import ArchiveExceptionHandler ARCH_EXT = [".tar.bz2", ".tar.gz", ".bz2", ".gz", ".tar.xz", ".tar", ".tbz2", ".tgz", ".lzma2", ".zip", ".7z", ".z", ".rar", ".iso", ".wim", ".cab", ".apm", ".arj", ".chm", @@ -48,7 +48,7 @@ def clean_all(): def exit_clean_up(signal, frame): try: - LOGGER.info("Cleaning up the downloads and exiting") + LOGGER.info("Cleaning up and exiting") clean_all() sys.exit(0) except KeyboardInterrupt: @@ -71,7 +71,7 @@ def get_base_name(orig_path: str): ext = ext[0] return re.split(ext + '$', orig_path, maxsplit=1, flags=re.I)[0] else: - raise CompressExceptionHandler('Unsupported file format') + raise ArchiveExceptionHandler("Unsupported archive file") def get_mime_type(file_path): mime = magic.Magic(mime=True) diff --git a/bot/helper/status_utils/archive_status.py b/bot/helper/status_utils/compress_status.py similarity index 88% rename from bot/helper/status_utils/archive_status.py rename to bot/helper/status_utils/compress_status.py index 2b58e997..291f202d 100644 --- a/bot/helper/status_utils/archive_status.py +++ b/bot/helper/status_utils/compress_status.py @@ -4,7 +4,7 @@ from bot.helper.ext_utils.bot_utils import TaskStatus, get_readable_file_size, get_readable_time from bot.helper.ext_utils.fs_utils import get_path_size -class ArchiveStatus: +class CompressStatus: def __init__(self, name, size, gid, listener): self.__name = name self.__size = size @@ -49,7 +49,7 @@ def eta(self): return '-' def status(self): - return TaskStatus.STATUS_ARCHIVING + return TaskStatus.STATUS_COMPRESSING def processed_bytes(self): return get_path_size(f"{DOWNLOAD_DIR}{self.__uid}") - self.__size @@ -58,7 +58,7 @@ def download(self): return self def cancel_task(self): - LOGGER.info(f"Cancelling archive: {self.__name}") + LOGGER.info(f"Cancelling compress: {self.__name}") if self.__listener.suproc is not None: self.__listener.suproc.kill() - self.__listener.onUploadError("The archive task has been cancelled") + self.__listener.onUploadError("The compression task has been cancelled") diff --git a/bot/helper/status_utils/extract_status.py b/bot/helper/status_utils/extract_status.py index 5d4744ae..ee31d2e1 100644 --- a/bot/helper/status_utils/extract_status.py +++ b/bot/helper/status_utils/extract_status.py @@ -61,4 +61,4 @@ def cancel_task(self): LOGGER.info(f"Cancelling extract: {self.__name}") if self.__listener.suproc is not None: self.__listener.suproc.kill() - self.__listener.onUploadError("The extract task has been cancelled") + self.__listener.onUploadError("The extraction task has been cancelled") diff --git a/bot/helper/telegram_helper/bot_commands.py b/bot/helper/telegram_helper/bot_commands.py index 98dd8ab1..675c83b4 100644 --- a/bot/helper/telegram_helper/bot_commands.py +++ b/bot/helper/telegram_helper/bot_commands.py @@ -3,7 +3,7 @@ def __init__(self): self.StartCommand = 'start' self.ListCommand = 'find' self.CloneCommand = 'clone' - self.ArchiveCommand = 'archive' + self.CompressCommand = 'compress' self.ExtractCommand = 'extract' self.CountCommand = 'count' self.CancelCommand = 'cancel' diff --git a/bot/helper/telegram_helper/message_utils.py b/bot/helper/telegram_helper/message_utils.py index 9dafff01..6d85f043 100644 --- a/bot/helper/telegram_helper/message_utils.py +++ b/bot/helper/telegram_helper/message_utils.py @@ -18,8 +18,8 @@ def sendMessage(text: str, bot, message: Message): LOGGER.warning(str(r)) time.sleep(r.retry_after * 1.5) return sendMessage(text, bot, message) - except Exception as e: - LOGGER.error(str(e)) + except Exception as err: + LOGGER.error(str(err)) return def sendMarkup(text: str, bot, message: Message, reply_markup: InlineKeyboardMarkup): @@ -32,8 +32,8 @@ def sendMarkup(text: str, bot, message: Message, reply_markup: InlineKeyboardMar LOGGER.warning(str(r)) time.sleep(r.retry_after * 1.5) return sendMarkup(text, bot, message, reply_markup) - except Exception as e: - LOGGER.error(str(e)) + except Exception as err: + LOGGER.error(str(err)) return def editMessage(text: str, message: Message, reply_markup=None): @@ -46,16 +46,16 @@ def editMessage(text: str, message: Message, reply_markup=None): LOGGER.warning(str(r)) time.sleep(r.retry_after * 1.5) return editMessage(text, message, reply_markup) - except Exception as e: - LOGGER.error(str(e)) - return str(e) + except Exception as err: + LOGGER.error(str(err)) + return str(err) def deleteMessage(bot, message: Message): try: bot.deleteMessage(chat_id=message.chat.id, message_id=message.message_id) - except Exception as e: - LOGGER.error(str(e)) + except Exception as err: + LOGGER.error(str(err)) def sendLogFile(bot, message: Message): with open('log.txt', 'rb') as f: @@ -69,12 +69,12 @@ def delete_all_messages(): try: deleteMessage(bot, data[0]) del status_reply_dict[data[0].chat.id] - except Exception as e: - LOGGER.error(str(e)) + except Exception as err: + LOGGER.error(str(err)) def update_all_messages(force=False): with status_reply_dict_lock: - if not force and (not status_reply_dict or not Interval or time.time() - list(status_reply_dict.values())[0][1] < 3): + if not status_reply_dict or not Interval or (not force and time.time() - list(status_reply_dict.values())[0][1] < 3): return for chat_id in status_reply_dict: status_reply_dict[chat_id][1] = time.time() diff --git a/bot/modules/compress.py b/bot/modules/archive.py similarity index 86% rename from bot/modules/compress.py rename to bot/modules/archive.py index 3dd64556..6e64e982 100644 --- a/bot/modules/compress.py +++ b/bot/modules/archive.py @@ -13,21 +13,21 @@ from bot.helper.download_utils.gd_downloader import add_gd_download from bot.helper.drive_utils.gdriveTools import GoogleDriveHelper from bot.helper.ext_utils.bot_utils import is_gdrive_link, is_appdrive_link, is_gdtot_link -from bot.helper.ext_utils.exceptions import CompressExceptionHandler, DDLExceptionHandler +from bot.helper.ext_utils.exceptions import ArchiveExceptionHandler, DDLExceptionHandler from bot.helper.ext_utils.fs_utils import clean_download, clean_target, get_base_name, get_path_size -from bot.helper.status_utils.archive_status import ArchiveStatus +from bot.helper.status_utils.compress_status import CompressStatus from bot.helper.status_utils.extract_status import ExtractStatus from bot.helper.status_utils.upload_status import UploadStatus from bot.helper.telegram_helper.bot_commands import BotCommands from bot.helper.telegram_helper.filters import CustomFilters from bot.helper.telegram_helper.message_utils import sendMessage, deleteMessage, delete_all_messages, update_all_messages -class CompressListener: - def __init__(self, bot, message, is_archive=False, is_extract=False, pswd=None): +class ArchiveListener: + def __init__(self, bot, message, is_compress=False, is_extract=False, pswd=None): self.bot = bot self.message = message self.uid = message.message_id - self.is_archive = is_archive + self.is_compress = is_compress self.is_extract = is_extract self.pswd = pswd self.dir = f'{DOWNLOAD_DIR}{self.uid}' @@ -48,11 +48,11 @@ def onDownloadComplete(self): gid = download.gid() m_path = f'{self.dir}/{name}' size = get_path_size(m_path) - if self.is_archive: + if self.is_compress: path = f"{m_path}.zip" with download_dict_lock: - download_dict[self.uid] = ArchiveStatus(name, size, gid, self) - LOGGER.info(f"Archiving: {name}") + download_dict[self.uid] = CompressStatus(name, size, gid, self) + LOGGER.info(f"Compressing: {name}") if self.pswd is not None: self.suproc = subprocess.Popen(["7z", "a", "-mx=0", f"-p{self.pswd}", path, m_path]) else: @@ -107,8 +107,8 @@ def onDownloadComplete(self): else: LOGGER.error("Failed to extract the archive") path = m_path - except CompressExceptionHandler as err: - LOGGER.info(err) + except ArchiveExceptionHandler as err: + LOGGER.error(err) path = m_path else: path = m_path @@ -126,7 +126,7 @@ def onDownloadComplete(self): def onUploadComplete(self, link: str, size, files, folders, typ, name): msg = f'Name: {escape(name)}' msg += f'\nSize: {size}' - msg += f'\nType: {typ}' + msg += f'\nType: {typ}' if typ == "Folder": msg += f'\nSubFolders: {folders}' msg += f'\nFiles: {files}' @@ -144,8 +144,8 @@ def onUploadComplete(self, link: str, size, files, folders, typ, name): with download_dict_lock: try: del download_dict[self.uid] - except Exception as e: - LOGGER.error(str(e)) + except Exception as err: + LOGGER.error(err) count = len(download_dict) if count == 0: self.clean() @@ -158,8 +158,8 @@ def onDownloadError(self, error): with download_dict_lock: try: del download_dict[self.uid] - except Exception as e: - LOGGER.error(str(e)) + except Exception as err: + LOGGER.error(err) count = len(download_dict) sendMessage(error, self.bot, self.message) if count == 0: @@ -173,8 +173,8 @@ def onUploadError(self, error): with download_dict_lock: try: del download_dict[self.uid] - except Exception as e: - LOGGER.error(str(e)) + except Exception as err: + LOGGER.error(err) count = len(download_dict) sendMessage(error, self.bot, self.message) if count == 0: @@ -182,7 +182,7 @@ def onUploadError(self, error): else: update_all_messages() -def _compress(bot, message, is_archive=False, is_extract=False, pswd=None): +def _archive(bot, message, is_compress=False, is_extract=False): mesg = message.text.split('\n') message_args = mesg[0].split(maxsplit=1) name_arg = mesg[0].split('|', maxsplit=1) @@ -223,11 +223,11 @@ def _compress(bot, message, is_archive=False, is_extract=False, pswd=None): if is_gdtot: link = gdtot(link) deleteMessage(bot, msg) - except DDLExceptionHandler as e: + except DDLExceptionHandler as err: deleteMessage(bot, msg) - LOGGER.error(str(e)) - return sendMessage(str(e), bot, message) - listener = CompressListener(bot, message, is_archive, is_extract, pswd) + LOGGER.error(err) + return sendMessage(str(err), bot, message) + listener = ArchiveListener(bot, message, is_compress, is_extract, pswd) if is_gdrive_link(link): threading.Thread(target=add_gd_download, args=(link, f'{DOWNLOAD_DIR}{listener.uid}', listener, name, is_appdrive, appdict, is_gdtot)).start() else: @@ -238,15 +238,15 @@ def _compress(bot, message, is_archive=False, is_extract=False, pswd=None): sendMessage(help_msg, bot, message) -def archive_data(update, context): - _compress(context.bot, update.message, is_archive=True) +def compress_data(update, context): + _archive(context.bot, update.message, is_compress=True) def extract_data(update, context): - _compress(context.bot, update.message, is_extract=True) + _archive(context.bot, update.message, is_extract=True) -archive_handler = CommandHandler(BotCommands.ArchiveCommand, archive_data, - filters=CustomFilters.authorized_chat | CustomFilters.authorized_user, run_async=True) +compress_handler = CommandHandler(BotCommands.CompressCommand, compress_data, + filters=CustomFilters.authorized_chat | CustomFilters.authorized_user, run_async=True) extract_handler = CommandHandler(BotCommands.ExtractCommand, extract_data, filters=CustomFilters.authorized_chat | CustomFilters.authorized_user, run_async=True) -dispatcher.add_handler(archive_handler) +dispatcher.add_handler(compress_handler) dispatcher.add_handler(extract_handler) diff --git a/bot/modules/auth.py b/bot/modules/auth.py index 65b76495..e13fbfbc 100644 --- a/bot/modules/auth.py +++ b/bot/modules/auth.py @@ -7,7 +7,7 @@ from bot.helper.ext_utils.database import DatabaseHelper def authorize(update, context): - user_id = "" + user_id = '' reply_message = update.message.reply_to_message if len(context.args) == 1: user_id = int(context.args[0]) @@ -35,7 +35,7 @@ def authorize(update, context): sendMessage(msg, context.bot, update.message) def unauthorize(update, context): - user_id = "" + user_id = '' reply_message = update.message.reply_to_message if len(context.args) == 1: user_id = int(context.args[0]) @@ -62,17 +62,17 @@ def unauthorize(update, context): msg = 'Already unauthorized' sendMessage(msg, context.bot, update.message) -def auth_chats(update, context): +def auth_users(update, context): users = '' users += '\n'.join(f"{uid}" for uid in AUTHORIZED_CHATS) - msg = f'Authorized Chats\n{users}' + msg = f'Authorized Users\n{users}' sendMessage(msg, context.bot, update.message) authorize_handler = CommandHandler(BotCommands.AuthorizeCommand, authorize, filters=CustomFilters.owner_filter, run_async=True) unauthorize_handler = CommandHandler(BotCommands.UnauthorizeCommand, unauthorize, - filters=CustomFilters.owner_filter, run_async=True) -auth_handler = CommandHandler(BotCommands.UsersCommand, auth_chats, + filters=CustomFilters.owner_filter, run_async=True) +auth_handler = CommandHandler(BotCommands.UsersCommand, auth_users, filters=CustomFilters.owner_filter, run_async=True) dispatcher.add_handler(authorize_handler) dispatcher.add_handler(unauthorize_handler) diff --git a/bot/modules/clone.py b/bot/modules/clone.py index dacbbeb9..e992f0c1 100644 --- a/bot/modules/clone.py +++ b/bot/modules/clone.py @@ -45,10 +45,10 @@ def cloneNode(update, context): if is_gdtot: link = gdtot(link) deleteMessage(context.bot, msg) - except DDLExceptionHandler as e: + except DDLExceptionHandler as err: deleteMessage(context.bot, msg) - LOGGER.error(str(e)) - return sendMessage(str(e), context.bot, update.message) + LOGGER.error(err) + return sendMessage(str(err), context.bot, update.message) if is_gdrive_link(link): msg = sendMessage(f"Checking: {link}", context.bot, update.message) LOGGER.info(f"Checking: {link}") diff --git a/bot/modules/list.py b/bot/modules/list.py index 82d9c0d7..c70e5cd3 100644 --- a/bot/modules/list.py +++ b/bot/modules/list.py @@ -20,9 +20,9 @@ def list_drive(update, context): gd = GoogleDriveHelper() try: msg, button = gd.drive_list(query) - except Exception as e: + except Exception as err: msg, button = "Internal error", None - LOGGER.exception(e) + LOGGER.error(err) editMessage(msg, reply, button) else: help_msg = 'Instructions\nSend a Query along with command' diff --git a/config_sample.env b/config_sample.env index e9411480..0f480668 100644 --- a/config_sample.env +++ b/config_sample.env @@ -12,7 +12,7 @@ STATUS_UPDATE_INTERVAL= TELEGRAPH_ACCS= INDEX_URL= CLONE_LIMIT= -COMPRESS_LIMIT= +ARCHIVE_LIMIT= TOKEN_JSON_URL= ACCOUNTS_ZIP_URL= DRIVE_LIST_URL=