diff --git a/any_dl.py b/any_dl.py index 1f5153e..84ccfb0 100644 --- a/any_dl.py +++ b/any_dl.py @@ -68,10 +68,10 @@ async def download_file(message, url, file_name): pass return file_name -image_ext = tuple([".jpg", ".png", ".jpeg"]) -vid_ext = tuple([".mp4", ".mkv"]) -sticker_ext = tuple([".wepb", ".tgs"]) -song_ext = tuple([".mp3", ".wav", ".m4a"]) +image_ext = ".jpg", ".png", ".jpeg" +vid_ext = ".mp4", ".mkv" +sticker_ext = ".wepb", ".tgs" +song_ext = ".mp3", ".wav", ".m4a" async def upload_file(client, reply_message, message, file_path, caption): rndm = uuid.uuid4().hex diff --git a/harem.py b/harem.py index c7c574d..10826c6 100644 --- a/harem.py +++ b/harem.py @@ -86,19 +86,19 @@ async def remove_nsfw(client, message): async def is_harem_enabled(f, client, message): if Config.ENABLE_WAIFU_FOR_ALL_CHATS: - return bool(True) - return bool(True) if await is_chat_in_db(int(message.chat.id)) else bool(False) + return True + return bool(await is_chat_in_db(int(message.chat.id))) async def harem_event(f, client, message): if not message: - return bool(False) + return False if not message.photo: - return bool(False) + return False if not message.caption: - return bool(False) + return False if "add" in message.caption.lower(): - return bool(True) - return bool(False) + return True + return False @run_in_exc def get_data(img): diff --git a/helper_files/dl_helpers.py b/helper_files/dl_helpers.py index d7ffc99..a9cab9e 100644 --- a/helper_files/dl_helpers.py +++ b/helper_files/dl_helpers.py @@ -95,5 +95,5 @@ def find_between(start_string, end_string, to_find): result = re.search(_to_, to_find) if not result: return None - return result.group(1) + return result[1] diff --git a/unzip.py b/unzip.py index 16799f7..611a88d 100644 --- a/unzip.py +++ b/unzip.py @@ -45,8 +45,9 @@ async def test(client, message): end = datetime.now() ms = (end - start).seconds await Pablo.edit( - "Stored the zip to `{}` in {} seconds.".format(downloaded_file_name, ms) + f"Stored the zip to `{downloaded_file_name}` in {ms} seconds." ) + try: with zipfile.ZipFile(downloaded_file_name, "r") as zip_ref: zip_ref.extractall(extracted)