diff options
author | Jeix <devnull@localhost> | 2010-06-20 11:01:32 +0200 |
---|---|---|
committer | Jeix <devnull@localhost> | 2010-06-20 11:01:32 +0200 |
commit | d9c4deacd40bfc16aa8b0092e27241b6b215817a (patch) | |
tree | 3a6b13ed29facece3d7a1594042ee2e911ab063b /module/RequestFactory.py | |
parent | fix linklist.py (diff) | |
download | pyload-d9c4deacd40bfc16aa8b0092e27241b6b215817a.tar.xz |
New feature: XDCC Support
Works for links with the following schema: xdcc://.*?/.*?/#?\d+/? (regexp)
Example: xdcc://irc.server.net/botname/packid
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 |