diff options
Diffstat (limited to 'pyload/network/RequestFactory.py')
-rw-r--r-- | pyload/network/RequestFactory.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pyload/network/RequestFactory.py b/pyload/network/RequestFactory.py index 6811b11d8..58838e707 100644 --- a/pyload/network/RequestFactory.py +++ b/pyload/network/RequestFactory.py @@ -62,7 +62,18 @@ class RequestFactory: def getURL(self, *args, **kwargs): """ see HTTPRequest for argument list """ - h = HTTPRequest(None, self.getOptions()) + cj = None + + if 'cookies' in kwargs: + if isinstance(kwargs['cookies'], CookieJar): + cj = kwargs['cookies'] + elif isinstance(kwargs['cookies'], list): + cj = CookieJar(None) + for cookie in kwargs['cookies']: + if isinstance(cookie, tuple) and len(cookie) == 3: + cj.setCookie(*cookie) + + h = HTTPRequest(cj, self.getOptions()) try: rep = h.load(*args, **kwargs) finally: |