summaryrefslogtreecommitdiffstats
path: root/module/RequestFactory.py
diff options
context:
space:
mode:
authorGravatar Jeix <devnull@localhost> 2010-06-20 11:01:32 +0200
committerGravatar Jeix <devnull@localhost> 2010-06-20 11:01:32 +0200
commitd9c4deacd40bfc16aa8b0092e27241b6b215817a (patch)
tree3a6b13ed29facece3d7a1594042ee2e911ab063b /module/RequestFactory.py
parentfix linklist.py (diff)
downloadpyload-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.py16
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