Skip to content

Commit

Permalink
Add torrent from hash
Browse files Browse the repository at this point in the history
  • Loading branch information
hemantapkh committed Mar 28, 2023
1 parent 93b2860 commit 07eef5f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/commands/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down

0 comments on commit 07eef5f

Please sign in to comment.