Added http/https prefix to sabhost

This commit is contained in:
Remy
2011-08-16 23:55:00 -07:00
parent b9ed9bb753
commit cb69493b9e
2 changed files with 5 additions and 2 deletions

View File

@@ -58,7 +58,7 @@
<td>
<h3>SABnzbd Host:</h3><input type="text" name="sab_host" value="${config['sab_host']}" size="30" maxlength="40"><br>
<i class="smalltext">usually localhost:8080</i>
<i class="smalltext">usually http://localhost:8080</i>
</td>
<td>

View File

@@ -65,7 +65,10 @@ def sendNZB(nzb):
params['mode'] = 'addfile'
multiPartParams = {"nzbfile": (nzb.name+".nzb", nzb.extraInfo[0])}
url = "http://" + headphones.SAB_HOST + "/" + "api?" + urllib.urlencode(params)
if not headphones.SAB_HOST.startswith('http://') or headphones.SAB_HOST.startswith('https://'):
headphones.SAB_HOST = 'http://' + headphones.SAB_HOST
url = headphones.SAB_HOST + "/" + "api?" + urllib.urlencode(params)
try: