Merge remote-tracking branch 'Qt-dev/master' into develop

This commit is contained in:
rembo10
2014-01-13 10:31:22 +00:00
2 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -204,7 +204,7 @@
<div class="row">
<label>Transmission Host:</label>
<input type="text" name="transmission_host" value="${config['transmission_host']}" size="30">
<small>usually http://localhost:9091</small>
<small>usually http://localhost:9091, add transmission folder if you changed it, ex : http://localhost:9091/torrent</small>
</div>
<div class="row">
<label>Transmission Username:</label>
+8 -2
View File
@@ -20,6 +20,7 @@ import urllib2
import lib.simplejson as json
import base64
import time
import re
# This is just a simple script to send torrents to transmission. The
# intention is to turn this into a class where we can check the state
@@ -83,8 +84,13 @@ def torrentAction(method, arguments):
if host.endswith('/'):
host = host[:-1]
host = host + "/transmission/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', '')