def __init__(self, url, fileOrName, method="GET", postdata=None, cookies={}, headers=None, agent=None, timeout=None): # XXX re-add support for cookies and timeout to HTTPDownloader call HTTPDownloader.__init__(self, url, fileOrName, method=method, postdata=postdata, headers=headers, agent=agent) self.value = { "startTime": time.time(), "timeToConnect": 0, "timeToFirstByte": 0, "elapsedTime": 0, "bytesTransferred": 0, } self.cookies = cookies self.timeout = timeout
def __init__(self, url, fileOrName, writeProgress=None, *args, **kwargs): HTTPDownloader.__init__(self, url, fileOrName, supportPartial=0, *args, **kwargs) # Save callback(s) locally if writeProgress and not isinstance(writeProgress, list): writeProgress = [writeProgress] self.writeProgress = writeProgress # Initialize self.currentlength = 0 self.totallength = None
def __init__(self, url, fileOrName, writeProgress = None, *args, **kwargs): HTTPDownloader.__init__(self, url, fileOrName, supportPartial=0, *args, **kwargs) # Save callback(s) locally if writeProgress and type(writeProgress) is not list: writeProgress = [ writeProgress ] self.writeProgress = writeProgress # Initialize self.currentlength = 0 self.totallength = None
def __init__(self, url, fileOrName, writeProgress=None, *args, **kwargs): HTTPDownloader.__init__(self, url, fileOrName, *args, **kwargs) # Save callback(s) locally if writeProgress and type(writeProgress) is not list: writeProgress = [writeProgress] self.writeProgress = writeProgress # Initialize self.currentlength = 0 self.totallength = None
def __init__(self, url, fileOrName, method="GET", postdata=None, cookies={}, headers=None, agent=None, timeout=None): # XXX re-add support for cookies and timeout to HTTPDownloader call HTTPDownloader.__init__(self, url, fileOrName, method=method, postdata=postdata, headers=headers, agent=agent) self.value = { "startTime": time.time(), "timeToConnect": 0, "timeToFirstByte": 0, "elapsedTime": 0, "bytesTransferred": 0, } self.cookies = cookies self.timeout = timeout
def __init__(self, url, file, statusCallback=None, bucketFilter=None, *args, **kwargs): self.bytes_received = 0 self.statusHandler = statusCallback self.bucketFilter = bucketFilter # TODO: Apparently this only works for servers, not clients :/ #if self.bucketFilter: # self.protocol = ShapedProtocolFactory(self.protocol, self.bucketFilter) HTTPDownloader.__init__(self, url, file, supportPartial=1, agent='Downpour v%s' % VERSION, *args, **kwargs) self.origPartial = self.requestedPartial
def __init__(self, url, file, statusCallback=None, bucketFilter=None, *args, **kwargs): self.bytes_received = 0 self.encoding = None self.statusHandler = statusCallback self.bucketFilter = bucketFilter # TODO: Apparently this only works for servers, not clients :/ #if self.bucketFilter: # self.protocol = ShapedProtocolFactory(self.protocol, self.bucketFilter) HTTPDownloader.__init__(self, url, file, supportPartial=1, agent='Downpour v%s' % VERSION, *args, **kwargs) self.origPartial = self.requestedPartial