From 4f2aa07a955d9791d9acc47ba09e536eebaa67dc Mon Sep 17 00:00:00 2001 From: sushantjsr13 <33841353+sushantjsr13@users.noreply.github.com> Date: Sun, 1 Aug 2021 08:48:05 +0530 Subject: [PATCH] download a mirror when a magnet link is replied with /mirror Added the support to download torrent from "magnet links" only, when replied with /mirror to the message Test Evidence (GDrive Link) - https://drive.google.com/drive/folders/1I2CEaTqcoFNksZxijWBr5BOMLvAkINvM?usp=sharing --- bot/modules/mirror.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bot/modules/mirror.py b/bot/modules/mirror.py index d191b56..3cd8c74 100644 --- a/bot/modules/mirror.py +++ b/bot/modules/mirror.py @@ -274,6 +274,10 @@ def _mirror(bot, update, isTar=False, extract=False): file = i break + reply_text = reply_to.text.split('\n')[0] + if bot_utils.is_magnet(reply_text): + link = reply_text + if not bot_utils.is_url(link) and not bot_utils.is_magnet(link) or len(link) == 0: if file is not None: if file.mime_type != "application/x-bittorrent":