mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-19 10:05:30 +01:00
Added the possibility to make it work with transmission in a different subfolder
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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', '')
|
||||
|
||||
Reference in New Issue
Block a user