diff --git a/README.md b/README.md index b0764d1beb..99b8faafc0 100644 --- a/README.md +++ b/README.md @@ -447,6 +447,7 @@ help - All cmds with description - `FSUB_IDS`: Fill chat_id(-100xxxxxx) of groups/channel you want to force subscribe. Separate them by space. Int - Note: Bot should be added in the filled chat_id as admin - `BOT_PM`: File/links send to the BOT PM. Default is `False`. `Bool` + - `BOT_MAX_TASKS`: Limit the Maximum task for bots of group at a time. `Int`
  • GDrive Tools @@ -479,7 +480,7 @@ help - All cmds with description
  • - Telegram Leech + Telegram Leech & Mirror - `LEECH_SPLIT_SIZE`: Size of split in bytes. Default is `2GB`. Default is `4GB` if your account is premium. `Int` - `AS_DOCUMENT`: Default type of Telegram file upload. Default is `False` mean as media. `Bool` @@ -489,14 +490,18 @@ help - All cmds with description - `LEECH_FILENAME_SUFFIX`: Add custom suffix to leeched file name. `Str` - `LEECH_FILENAME_CAPTION`: Add custom caption to leeched file. `Str` - `LEECH_FILENAME_REMNAME`: Remove custom word from leeched file name. `Str` + - `MIRROR_FILENAME_PREFIX`: Add custom prefix to mirrored file name. `Str` + - `MIRROR_FILENAME_SUFFIX`: Add custom suffix to mirrored file name. `Str` + - `MIRROR_FILENAME_REMNAME`: Remove custom word from mirrored file name. `Str`
  • Log Channel - `LEECH_LOG_ID`: Chat ID to where leeched files would be uploaded. `Int`. **NOTE**: Only available for superGroup/channel. Add `-100` before channel/superGroup id. In short don't add bot id or your id! - - `MIRROR_LOG_ID`: Chat ID to where Mirror files would be Send. `Int`. **NOTE**: Only available for superGroup/channel. Add `-100` before channel/superGroup id. In short don't add bot id or your id!. - - **Note**: For Multiple id Separate them by space. + - `MIRROR_LOG_ID`: Chat ID to where Mirror files would be Send. `Int`. **NOTE**: Only available for superGroup/channel. Add `-100` before channel/superGroup id. In short don't add bot id or your id!. + - `LINKS_LOG_ID`: Chat ID to where Link logs would be Send. `Int`. **NOTE**: Only available for superGroup/channel. Add `-100` before channel/superGroup id. In short don't add bot id or your id!. + - **Note**: LEECH_LOG_ID & MIRROR_LOG_ID it's multiple, For multiple id Separate them by space.
  • qBittorrent/Aria2c @@ -567,6 +572,11 @@ help - All cmds with description
  • Extra + - `SAFE_MODE`: Remove all file names. Not from BOT_PM & LINK_LOGS. Default is `False`. `Bool` + - `DELETE_LINKS`: Delete links after used. Default is `False`. `Bool` + - `CLEAN_LOG_MSG`: Clean log msg. Default is `False`. `Bool` + - `SHOW_EXTRA_CMDS`: Add old cmds like zipleech... Default is `False`. `Bool` + - `SOURCE_LINK`: Source button of files and links. Default is `False`. `Bool` - `IMAGES`: Add multiple telgraph(graph.org) image links that are seperated by spaces. - `IMG_SEARCH`: Put Keyword to Download Images. Sperarte each name by , like `anime`, `iron man`, `god of war` - `IMG_PAGE`: Set the page value for downloading a image. Each page have approx 70 images. Deafult is `1`. `Int` diff --git a/bot/helper/listeners/tasks_listener.py b/bot/helper/listeners/tasks_listener.py index 4456f4e205..ad58e3fb82 100644 --- a/bot/helper/listeners/tasks_listener.py +++ b/bot/helper/listeners/tasks_listener.py @@ -94,12 +94,15 @@ def __setModeEng(self): def __parseSource(self): if self.source_url == self.message.link: file = self.message.reply_to_message - media = getattr(file, file.media.value) - self.source_msg = f'┎ Name: {media.file_name}\n' \ - f'┠ Type: {media.mime_type}\n' \ - f'┠ Size: {get_readable_file_size(media.file_size)}\n' \ - f'┠ Created Date: {media.date}\n' \ - f'┖ Media Type: {(file.media.value).capitalize()}' + if file is not None and file.media is not None: + media = getattr(file, file.media.value) + self.source_msg = f'┎ Name: {media.file_name}\n' \ + f'┠ Type: {media.mime_type}\n' \ + f'┠ Size: {get_readable_file_size(media.file_size)}\n' \ + f'┠ Created Date: {media.date}\n' \ + f'┖ Media Type: {(file.media.value).capitalize()}' + else: + self.source_msg = f"{self.message.reply_to_message.text}" elif self.source_url.startswith('https://t.me/share/url?url='): msg = self.source_url.replace('https://t.me/share/url?url=', '') if msg.startswith('magnet'): @@ -111,10 +114,11 @@ def __parseSource(self): elif check.startswith('magnet:?xt=urn:btih:'): hashh = check.replace('magnet:?xt=urn:btih:', '') else: - name += ('&' if amper else '') + check.replace("dn=", "") + name += ('&' if amper else '') + check.replace('dn=', '').replace('+', '') amper = True self.source_msg = f"┎ Name: {name}\n┠ Magnet Hash: {hashh}\n┠ Total Trackers: {tracCount} \n┖ Share: Share To Telegram" - else: self.source_msg = f"{msg}" + else: + self.source_msg = f"{msg}" else: self.source_msg = f"{self.source_url}" @@ -483,7 +487,7 @@ async def onUploadComplete(self, link, size, files, folders, mime_type, name, rc if is_DDL: buttons.ubutton(BotTheme('DDL_LINK', Serv='GoFile'), link) elif link: - if not config_dict['DISABLE_DRIVE_LINK'] and user_id == OWNER_ID: + if not config_dict['DISABLE_DRIVE_LINK'] and user_id != OWNER_ID: buttons.ubutton(BotTheme('CLOUD_LINK'), link) else: msg += BotTheme('RCPATH', RCpath=rclonePath) diff --git a/bot/helper/mirror_utils/upload_utils/pyrogramEngine.py b/bot/helper/mirror_utils/upload_utils/pyrogramEngine.py index 5eae3409ad..eb7883695f 100644 --- a/bot/helper/mirror_utils/upload_utils/pyrogramEngine.py +++ b/bot/helper/mirror_utils/upload_utils/pyrogramEngine.py @@ -273,7 +273,7 @@ async def upload(self, o_files, m_size, size): self.__last_uploaded = 0 await self.__switching_client() await self.__upload_file(cap_mono, file_) - if not isDeleted and config_dict['CLEAN_LOG_MSG']: + if self.__leechmsg and not isDeleted and config_dict['CLEAN_LOG_MSG']: await list(self.__leechmsg.values())[0].delete() isDeleted = True if self.__is_cancelled: diff --git a/bot/helper/telegram_helper/message_utils.py b/bot/helper/telegram_helper/message_utils.py index f5b514d4d7..3db48d6c66 100644 --- a/bot/helper/telegram_helper/message_utils.py +++ b/bot/helper/telegram_helper/message_utils.py @@ -138,6 +138,8 @@ async def editMessage(message, text, buttons=None, photo=None): return await editMessage(message, text, buttons, photo) except (MessageNotModified, MessageEmpty): pass + except ReplyMarkupInvalid: + return await editMessage(message, text, None, photo) except Exception as e: LOGGER.error(str(e)) return str(e) @@ -328,4 +330,4 @@ async def BotPm_check(message, button=None): button = ButtonMaker() _msg = "You didn't START the bot in PM (Private)" button.ubutton("Start Bot Now", f"https://t.me/{bot_name}?start=start", 'header') - return _msg, button \ No newline at end of file + return _msg, button diff --git a/config_sample.env b/config_sample.env index 767e3faf9a..572afaeb81 100644 --- a/config_sample.env +++ b/config_sample.env @@ -25,6 +25,7 @@ USE_SERVICE_ACCOUNTS = "False" SET_COMMANDS = "False" FSUB_IDS = "" BOT_PM = "" +BOT_MAX_TASKS = "" # GDrive Tools GDRIVE_ID = "" @@ -46,7 +47,7 @@ RCLONE_SERVE_PASS = "" UPSTREAM_REPO = "" UPSTREAM_BRANCH = "" -# Leech +# Leech & Mirror LEECH_SPLIT_SIZE = "" AS_DOCUMENT = "False" EQUAL_SPLITS = "False" @@ -56,10 +57,14 @@ LEECH_FILENAME_PREFIX = "" LEECH_FILENAME_SUFFIX = "" LEECH_FILENAME_CAPTION = "" LEECH_FILENAME_REMNAME = "" +MIRROR_FILENAME_PREFIX = "" +MIRROR_FILENAME_SUFFIX = "" +MIRROR_FILENAME_REMNAME = "" # Log Channel (Single ID) LEECH_LOG_ID = "" MIRROR_LOG_ID = "" +LINKS_LOG_ID = "" # qBittorrent/Aria2c TORRENT_TIMEOUT = "" @@ -107,6 +112,10 @@ AUTHOR_URL = "https://t.me/WZML_X" # Extra SAFE_MODE = "" +DELETE_LINKS = "" +CLEAN_LOG_MSG = "" +SHOW_EXTRA_CMDS = "" +SOURCE_LINK = "" TIMEZONE = "Asia/Kolkata" IMAGES = "" IMG_SEARCH = ""