From 2d9084006c14eb81089a007465b746c6b82e46c0 Mon Sep 17 00:00:00 2001 From: anasty17 Date: Mon, 23 Dec 2024 23:58:03 +0200 Subject: [PATCH] leech without thumb - only by using arg -t none close #1768 Signed-off-by: anasty17 --- README.md | 2 +- bot/helper/common.py | 2 +- bot/helper/ext_utils/help_messages.py | 2 +- bot/helper/mirror_leech_utils/telegram_uploader.py | 12 +++++++++--- web/__init__.py | 1 + 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 30465ce0..b228cf31 100644 --- a/README.md +++ b/README.md @@ -384,7 +384,7 @@ Fill up rest of the fields. Meaning of each field is discussed below. Default api limit for each site). `Int` - `SEARCH_PLUGINS`: List of qBittorrent search plugins (github raw links). I have added some plugins, you can remove/add plugins as you want. Main - Source: [qBittorrent Search Plugins (Official/Unofficial)](https://github.com/qbittorrent/search-plugins/wiki/Unofficial-search-plugins). `List` + Source: [qBittorrent Search Plugins (Official/Unofficial)](https://github.com/qbittorrent/search-plugins). `List` ------ diff --git a/bot/helper/common.py b/bot/helper/common.py index 5bd9ceca..f83c3f05 100644 --- a/bot/helper/common.py +++ b/bot/helper/common.py @@ -415,7 +415,7 @@ class TaskConfig: ) ) - if is_telegram_link(self.thumb): + if self.thumb != "none" and is_telegram_link(self.thumb): msg = (await get_tg_link_message(self.thumb))[0] self.thumb = ( await create_thumb(msg) if msg.photo or msg.document else "" diff --git a/bot/helper/ext_utils/help_messages.py b/bot/helper/ext_utils/help_messages.py index bdd4e0da..fc726790 100644 --- a/bot/helper/ext_utils/help_messages.py +++ b/bot/helper/ext_utils/help_messages.py @@ -56,7 +56,7 @@ link6 will get uploaded normally alone thumb = """Thumbnail for current task: -t -/cmd link -t tg-message-link(doc or photo)""" +/cmd link -t tg-message-link (doc or photo) or none (file without thumb)""" split_size = """Split size for current task: -sp diff --git a/bot/helper/mirror_leech_utils/telegram_uploader.py b/bot/helper/mirror_leech_utils/telegram_uploader.py index 75539f59..534f35da 100644 --- a/bot/helper/mirror_leech_utils/telegram_uploader.py +++ b/bot/helper/mirror_leech_utils/telegram_uploader.py @@ -85,7 +85,7 @@ class TelegramUploader: if "lprefix" not in self._listener.user_dict else "" ) - if not await aiopath.exists(self._thumb): + if self._thumb != "none" and not await aiopath.exists(self._thumb): self._thumb = None async def _msg_to_reply(self): @@ -362,7 +362,7 @@ class TelegramUploader: retry=retry_if_exception_type(Exception), ) async def _upload_file(self, cap_mono, file, o_path, force_document=False): - if self._thumb is not None and not await aiopath.exists(self._thumb): + if self._thumb is not None and not await aiopath.exists(self._thumb) and self._thumb != "none": self._thumb = None thumb = self._thumb self._is_corrupted = False @@ -388,6 +388,8 @@ class TelegramUploader: if self._listener.is_cancelled: return + if thumb == "none": + thumb = None self._sent_msg = await self._sent_msg.reply_document( document=self._up_path, quote=True, @@ -408,7 +410,7 @@ class TelegramUploader: ) if thumb is None: thumb = await get_video_thumbnail(self._up_path, duration) - if thumb is not None: + if thumb is not None and thumb != "none": with Image.open(thumb) as img: width, height = img.size else: @@ -416,6 +418,8 @@ class TelegramUploader: height = 320 if self._listener.is_cancelled: return + if thumb == "none": + thumb = None self._sent_msg = await self._sent_msg.reply_video( video=self._up_path, quote=True, @@ -433,6 +437,8 @@ class TelegramUploader: duration, artist, title = await get_media_info(self._up_path) if self._listener.is_cancelled: return + if thumb == "none": + thumb = None self._sent_msg = await self._sent_msg.reply_audio( audio=self._up_path, quote=True, diff --git a/web/__init__.py b/web/__init__.py index e69de29b..d3f5a12f 100644 --- a/web/__init__.py +++ b/web/__init__.py @@ -0,0 +1 @@ +