diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-12-29 12:18:51 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-12-29 12:18:51 +0100 |
commit | d007aac6244a63ee49cf155de3c8af1b4b94d4c3 (patch) | |
tree | fb0f71e203841a7867fd405a5ff4a3b71dd3e646 /pyload/plugins/Request.py | |
parent | disabled colored log on windows (diff) | |
download | pyload-d007aac6244a63ee49cf155de3c8af1b4b94d4c3.tar.xz |
added auth to request class
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""" |