@@ -28,6 +28,8 @@ def __init__(self):
2828 {'type' : 'text' , 'label' : 'Menu name' , 'name' : 'deluge_name' },
2929 {'type' : 'text' , 'label' : 'IP / Host *' , 'name' : 'deluge_host' },
3030 {'type' : 'text' , 'label' : 'Port *' , 'name' : 'deluge_port' },
31+ {'type' : 'bool' , 'label' : 'Use SSL' , 'name' : 'deluge_ssl' },
32+ {'type' : 'text' , 'label' : 'Basepath' , 'name' : 'deluge_basepath' },
3133 {'type' : 'password' , 'label' : 'Password' , 'name' : 'deluge_password' }
3234 ]})
3335
@@ -111,8 +113,10 @@ def read_data(self,data):
111113
112114 host = htpc .settings .get ('deluge_host' , '' )
113115 port = str (htpc .settings .get ('deluge_port' , '' ))
116+ deluge_basepath = str (htpc .settings .get ('deluge_basepath' , '' ))
117+ ssl = 's' if htpc .settings .get ('deluge_ssl' ) else ''
114118
115- url = 'http://' + host + ':' + str (port ) + '/json'
119+ url = 'http' + ssl + ' ://' + host + ':' + str (port ) + deluge_basepath + '/json'
116120
117121 post_data = dumps (data )
118122 buf = StringIO ( self .opener .open (url , post_data ,1 ).read ())
0 commit comments