mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-22 08:53:59 +01:00
Transmission change for rutracker
use metainfo for local .torrent files (will only be rutracker)
This commit is contained in:
@@ -30,7 +30,14 @@ from headphones import logger, notifiers, request
|
|||||||
|
|
||||||
def addTorrent(link):
|
def addTorrent(link):
|
||||||
method = 'torrent-add'
|
method = 'torrent-add'
|
||||||
arguments = {'filename': link, 'download-dir': headphones.DOWNLOAD_TORRENT_DIR}
|
|
||||||
|
if link.endswith('.torrent'):
|
||||||
|
f = open(link,'rb')
|
||||||
|
metainfo = str(base64.b64encode(f.read()))
|
||||||
|
f.close()
|
||||||
|
arguments = {'metainfo': metainfo, 'download-dir':headphones.DOWNLOAD_TORRENT_DIR}
|
||||||
|
else:
|
||||||
|
arguments = {'filename': link, 'download-dir': headphones.DOWNLOAD_TORRENT_DIR}
|
||||||
|
|
||||||
response = torrentAction(method,arguments)
|
response = torrentAction(method,arguments)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user