diff options
Diffstat (limited to 'module/RequestFactory.py')
-rw-r--r-- | module/RequestFactory.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/module/RequestFactory.py b/module/RequestFactory.py index e707ea6cd..410d5ccd5 100644 --- a/module/RequestFactory.py +++ b/module/RequestFactory.py @@ -19,6 +19,7 @@ from threading import Lock from module.network.Request import Request +from module.network.XdccRequest import XdccRequest import pycurl class RequestFactory(): @@ -28,12 +29,17 @@ class RequestFactory(): self.requests = [] self.cookiejars = [] - def getRequest(self, pluginName, account=None): + def getRequest(self, pluginName, account=None, type="HTTP"): self.lock.acquire() - iface = self.core.config["general"]["download_interface"] - req = Request(interface=str(iface)) - cj = self.getCookieJar(pluginName, account) - req.setCookieJar(cj) + if type == "HTTP": + iface = self.core.config["general"]["download_interface"] + req = Request(interface=str(iface)) + cj = self.getCookieJar(pluginName, account) + req.setCookieJar(cj) + + elif type == "XDCC": + req = XdccRequest() + self.requests.append((pluginName, account, req)) self.lock.release() return req |