The transmission url detection now :

- is executed only if the url is not already ending with rpc
  - detects ports up to 6 digits long (changed from 4)
This commit is contained in:
Quentin
2014-01-11 13:19:15 +01:00
parent b872966011
commit 62f294a51d

View File

@@ -85,10 +85,12 @@ def torrentAction(method, arguments):
if host.endswith('/'):
host = host[:-1]
if host.endswith(':\d{2,4}'):
host = host + "/transmission/rpc"
else
host = host + "/rpc"
if not host.endswith('/rpc'):
if host.endswith(':\d{2,6}'):
host = host + "/transmission/rpc"
else:
host = host + "/rpc"
request = urllib2.Request(host)
if username and password:
base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '')