From cb69493b9ec30754254c02ceddbe51a6d56a59f0 Mon Sep 17 00:00:00 2001 From: Remy Date: Tue, 16 Aug 2011 23:55:00 -0700 Subject: [PATCH] Added http/https prefix to sabhost --- data/interfaces/default/config.html | 2 +- headphones/sab.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 4993192d..4c39f17d 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -58,7 +58,7 @@

SABnzbd Host:


- usually localhost:8080 + usually http://localhost:8080 diff --git a/headphones/sab.py b/headphones/sab.py index d6433ce7..8c20d717 100644 --- a/headphones/sab.py +++ b/headphones/sab.py @@ -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: