mirror of
https://github.com/anasty17/mirror-leech-telegram-bot.git
synced 2025-01-07 03:26:46 +08:00
leech without thumb
- only by using arg -t none close #1768 Signed-off-by: anasty17 <e.anastayyar@gmail.com>
This commit is contained in:
parent
24ccebe744
commit
2d9084006c
@ -384,7 +384,7 @@ Fill up rest of the fields. Meaning of each field is discussed below.
|
|||||||
Default api limit for each site). `Int`
|
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
|
- `SEARCH_PLUGINS`: List of qBittorrent search plugins (github raw links). I have added some plugins, you can remove/add
|
||||||
plugins as you want. Main
|
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`
|
||||||
|
|
||||||
------
|
------
|
||||||
|
|
||||||
|
@ -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]
|
msg = (await get_tg_link_message(self.thumb))[0]
|
||||||
self.thumb = (
|
self.thumb = (
|
||||||
await create_thumb(msg) if msg.photo or msg.document else ""
|
await create_thumb(msg) if msg.photo or msg.document else ""
|
||||||
|
@ -56,7 +56,7 @@ link6 will get uploaded normally alone
|
|||||||
|
|
||||||
thumb = """<b>Thumbnail for current task</b>: -t
|
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
|
split_size = """<b>Split size for current task</b>: -sp
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ class TelegramUploader:
|
|||||||
if "lprefix" not in self._listener.user_dict
|
if "lprefix" not in self._listener.user_dict
|
||||||
else ""
|
else ""
|
||||||
)
|
)
|
||||||
if not await aiopath.exists(self._thumb):
|
if self._thumb != "none" and not await aiopath.exists(self._thumb):
|
||||||
self._thumb = None
|
self._thumb = None
|
||||||
|
|
||||||
async def _msg_to_reply(self):
|
async def _msg_to_reply(self):
|
||||||
@ -362,7 +362,7 @@ class TelegramUploader:
|
|||||||
retry=retry_if_exception_type(Exception),
|
retry=retry_if_exception_type(Exception),
|
||||||
)
|
)
|
||||||
async def _upload_file(self, cap_mono, file, o_path, force_document=False):
|
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
|
self._thumb = None
|
||||||
thumb = self._thumb
|
thumb = self._thumb
|
||||||
self._is_corrupted = False
|
self._is_corrupted = False
|
||||||
@ -388,6 +388,8 @@ class TelegramUploader:
|
|||||||
|
|
||||||
if self._listener.is_cancelled:
|
if self._listener.is_cancelled:
|
||||||
return
|
return
|
||||||
|
if thumb == "none":
|
||||||
|
thumb = None
|
||||||
self._sent_msg = await self._sent_msg.reply_document(
|
self._sent_msg = await self._sent_msg.reply_document(
|
||||||
document=self._up_path,
|
document=self._up_path,
|
||||||
quote=True,
|
quote=True,
|
||||||
@ -408,7 +410,7 @@ class TelegramUploader:
|
|||||||
)
|
)
|
||||||
if thumb is None:
|
if thumb is None:
|
||||||
thumb = await get_video_thumbnail(self._up_path, duration)
|
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:
|
with Image.open(thumb) as img:
|
||||||
width, height = img.size
|
width, height = img.size
|
||||||
else:
|
else:
|
||||||
@ -416,6 +418,8 @@ class TelegramUploader:
|
|||||||
height = 320
|
height = 320
|
||||||
if self._listener.is_cancelled:
|
if self._listener.is_cancelled:
|
||||||
return
|
return
|
||||||
|
if thumb == "none":
|
||||||
|
thumb = None
|
||||||
self._sent_msg = await self._sent_msg.reply_video(
|
self._sent_msg = await self._sent_msg.reply_video(
|
||||||
video=self._up_path,
|
video=self._up_path,
|
||||||
quote=True,
|
quote=True,
|
||||||
@ -433,6 +437,8 @@ class TelegramUploader:
|
|||||||
duration, artist, title = await get_media_info(self._up_path)
|
duration, artist, title = await get_media_info(self._up_path)
|
||||||
if self._listener.is_cancelled:
|
if self._listener.is_cancelled:
|
||||||
return
|
return
|
||||||
|
if thumb == "none":
|
||||||
|
thumb = None
|
||||||
self._sent_msg = await self._sent_msg.reply_audio(
|
self._sent_msg = await self._sent_msg.reply_audio(
|
||||||
audio=self._up_path,
|
audio=self._up_path,
|
||||||
quote=True,
|
quote=True,
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
|
Loading…
Reference in New Issue
Block a user