leech without thumb

- only by using arg -t none

close #1768

Signed-off-by: anasty17 <e.anastayyar@gmail.com>
This commit is contained in:
anasty17 2024-12-23 23:58:03 +02:00
parent 24ccebe744
commit 2d9084006c
No known key found for this signature in database
GPG Key ID: EAAC8A2DF2861DE4
5 changed files with 13 additions and 6 deletions

View File

@ -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`
------

View File

@ -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 ""

View File

@ -56,7 +56,7 @@ link6 will get uploaded normally alone
thumb = """<b>Thumbnail for current task</b>: -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 = """<b>Split size for current task</b>: -sp

View File

@ -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,

View File

@ -0,0 +1 @@