diff options
Diffstat (limited to 'pyload/plugins/Request.py')
-rw-r--r-- | pyload/plugins/Request.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pyload/plugins/Request.py b/pyload/plugins/Request.py index 8e8e0cc6b..9f6fe8c2b 100644 --- a/pyload/plugins/Request.py +++ b/pyload/plugins/Request.py @@ -59,7 +59,16 @@ class Request(object): if name == "": self.options.clear() else: - del self.options[name] + if name in self.options: + del self.options[name] + + def addAuth(self, user, pwd): + """ Adds authentication information to the request """ + self.options["auth"] = user + ":" + pwd + + def removeAuth(self): + """ Removes authentication from the request """ + self.unsetOption("auth") def load(self, uri, *args, **kwargs): """ Loads given resource from given uri. Args and kwargs depends on implementation""" |