1 parent
4ec32a6403
commit
046c7e732f
2 files changed
+10
-3
No files matched your search
@@ -25,6 +25,13 @@ config = [{
|
|||||||
'default': 'localhost:9091',
|
'default': 'localhost:9091',
|
||||||
'description': 'Hostname with port. Usually <strong>localhost:9091</strong>',
|
'description': 'Hostname with port. Usually <strong>localhost:9091</strong>',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'name': 'rpc_url',
|
||||||
|
'type': 'string',
|
||||||
|
'default': 'transmission',
|
||||||
|
'advanced': True,
|
||||||
|
'description': 'Change if you don\'t run Transmission RPC at the default url.',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'name': 'username',
|
'name': 'username',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class Transmission(Downloader):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
if not self.trpc:
|
if not self.trpc:
|
||||||
self.trpc = TransmissionRPC(host[0], port = host[1], username = self.conf('username'), password = self.conf('password'))
|
self.trpc = TransmissionRPC(host[0], port = host[1], rpc_url = self.conf('rpc_url'), username = self.conf('username'), password = self.conf('password'))
|
||||||
|
|
||||||
return self.trpc
|
return self.trpc
|
||||||
|
|
||||||
@@ -144,11 +144,11 @@ class Transmission(Downloader):
|
|||||||
class TransmissionRPC(object):
|
class TransmissionRPC(object):
|
||||||
|
|
||||||
"""TransmissionRPC lite library"""
|
"""TransmissionRPC lite library"""
|
||||||
def __init__(self, host = 'localhost', port = 9091, username = None, password = None):
|
def __init__(self, host = 'localhost', port = 9091, rpc_url = 'transmission', username = None, password = None):
|
||||||
|
|
||||||
super(TransmissionRPC, self).__init__()
|
super(TransmissionRPC, self).__init__()
|
||||||
|
|
||||||
self.url = 'http://' + host + ':' + str(port) + '/transmission/rpc'
|
self.url = 'http://' + host + ':' + str(port) + '/' + rpc_url + '/rpc'
|
||||||
self.tag = 0
|
self.tag = 0
|
||||||
self.session_id = 0
|
self.session_id = 0
|
||||||
self.session = {}
|
self.session = {}
|
||||||
|
|||||||
Reference in new issue
Block a user