From 07eef5fc19a77465528877e1b8e830967fa1e750 Mon Sep 17 00:00:00 2001 From: Hemanta Pokharel Date: Tue, 28 Mar 2023 20:35:59 +0545 Subject: [PATCH] Add torrent from hash --- src/commands/start.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/start.py b/src/commands/start.py index 45d60c8..e75a0b6 100644 --- a/src/commands/start.py +++ b/src/commands/start.py @@ -22,11 +22,11 @@ def start(message): sent = bot.send_message(message.chat.id, text=language['processing'][userLanguage]) #! If add torrent paramater is passed via database key - if params.startswith('addTorrentDb'): - key = params[13:] - magnetLink = dbSql.getMagnet(key) + if params.startswith('addTorrent'): + hash = params.split('_')[1] + magnet = f"magnet:?xt=urn:btih:{hash}" - asyncio.run(addTorrent(message, userLanguage, magnetLink, messageId=sent.id)) + asyncio.run(addTorrent(message, userLanguage, magnet, messageId=sent.id)) #! If add torrent paramater is passed via URL elif params.startswith('addTorrentURL'):