MCPcopy Index your code
hub / github.com/pyload/pyload / __init__

Method __init__

module/network/HTTPDownload.py:38–76  ·  view source on GitHub ↗
(self, url, filename, size=0, get={}, post={}, referer=None, cj=None, bucket=None,
                 options={}, status_notify=None, disposition=False)

Source from the content-addressed store, hash-verified

36 """ loads a url http + ftp """
37
38 def __init__(self, url, filename, size=0, get={}, post={}, referer=None, cj=None, bucket=None,
39 options={}, status_notify=None, disposition=False):
40 self.url = url
41 self.filename = filename # complete file destination, not only name
42 self.get = get
43 self.post = post
44 self.referer = referer
45 self.cj = cj # cookiejar if cookies are needed
46 self.bucket = bucket
47 self.options = options
48 self.disposition = disposition
49 # all arguments
50
51 self.abort = False
52 self.size = size
53 self.nameDisposition = None # will be parsed from content disposition
54
55 self.chunks = []
56
57 self.log = getLogger("log")
58
59 try:
60 self.info = ChunkInfo.load(filename)
61 self.info.resume = True # resume is only possible with valid info file
62 self.size = self.info.size
63 self.infoSaved = True
64 except IOError:
65 self.info = ChunkInfo(filename)
66
67 self.chunkSupport = None
68 self.m = pycurl.CurlMulti()
69
70 # needed for speed calculation
71 self.lastArrived = []
72 self.speeds = []
73 self.lastSpeeds = [0, 0]
74
75 # notifications callback
76 self.status_notify = status_notify if callable(status_notify) else None
77
78 @property
79 def speed(self):

Callers

nothing calls this directly

Calls 2

ChunkInfoClass · 0.90
loadMethod · 0.45

Tested by

no test coverage detected