mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-22 03:17:45 +01:00
Merge remote-tracking branch 'Qt-dev/master' into develop
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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', '')
|
||||
|
||||
Reference in New Issue
Block a user