add two missing lines and do not add authorization header when no un and pw set
authorMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Fri, 10 Apr 2009 12:00:05 +0000 (12:00 +0000)
committerMoritz Venn <ritzmo@users.schwerkraft.elitedvb.net>
Fri, 10 Apr 2009 12:00:05 +0000 (12:00 +0000)
remotetimer/src/plugin.py

index d14c21c..8140cc4 100644 (file)
@@ -213,9 +213,16 @@ def newnigma2KeyGo(self):
                        rt_repeated
                )
                print "######### debug remote", remoteurl
-               basicAuth = encodestring("%s:%s" % (username, password))
-               authHeader = "Basic " + basicAuth.strip()
-               headers = {"Authorization": authHeader}
+
+               username = config.plugins.remoteTimer.username.value
+               password = config.plugins.remoteTimer.password.value
+               if username and password:
+                       basicAuth = encodestring("%s:%s" % (username, password))
+                       authHeader = "Basic " + basicAuth.strip()
+                       headers = {"Authorization": authHeader}
+               else:
+                       headers = {}
+
                defer = getPage(remoteurl, headers = headers)
                defer.addCallback(boundFunction(_gotPageLoad, self.session, self))
                defer.addErrback(boundFunction(errorLoad, self.session))