def getRequest(self, pluginName, account=None, type="HTTP"): self.lock.acquire() if type == "XDCC": return XDCCRequest(proxies=self.getProxies()) req = Browser(self.bucket, self.getOptions()) if account: cj = self.getCookieJar(pluginName, account) req.setCookieJar(cj) else: req.setCookieJar(CookieJar(pluginName)) self.lock.release() return req
def load(self, *args, **kwargs): post = kwargs.get("post") if post is None and len(args) > 2: post = args[2] if post: self.http.c.setopt(pycurl.FOLLOWLOCATION, 0) self.http.c.setopt(pycurl.POST, 1) self.http.c.setopt(pycurl.CUSTOMREQUEST, "POST") else: self.http.c.setopt(pycurl.FOLLOWLOCATION, 1) self.http.c.setopt(pycurl.POST, 0) self.http.c.setopt(pycurl.CUSTOMREQUEST, "GET") return Browser.load(self, *args, **kwargs)
def __init__(self, bucket=None, options={}): Browser.__init__(self, bucket, options)