Added the possibility to make it work with transmission in a different subfolder

This commit is contained in:
quentin
2013-11-05 14:50:34 +01:00
parent 18c4b87158
commit b872966011
2 changed files with 7 additions and 3 deletions

View File

@@ -196,7 +196,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>

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,11 @@ def torrentAction(method, arguments):
if host.endswith('/'):
host = host[:-1]
host = host + "/transmission/rpc"
if host.endswith(':\d{2,4}'):
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', '')