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

Method __init__

module/plugins/Plugin.py:153–206  ·  view source on GitHub ↗
(self, pyfile)

Source from the content-addressed store, hash-verified

151 __author_mail__ = ("RaNaN@pyload.org", "spoob@pyload.org", "mkaay@mkaay.de")
152
153 def __init__(self, pyfile):
154 Base.__init__(self, pyfile.m.core)
155
156 self.wantReconnect = False
157 #: enables simultaneous processing of multiple downloads
158 self.multiDL = True
159 self.limitDL = 0
160 #: chunk limit
161 self.chunkLimit = 1
162 self.resumeDownload = False
163
164 #: time() + wait in seconds
165 self.waitUntil = 0
166 self.waiting = False
167
168 self.ocr = None #captcha reader instance
169 #: account handler instance, see :py:class:`Account`
170 self.account = pyfile.m.core.accountManager.getAccountPlugin(self.__name__)
171
172 #: premium status
173 self.premium = False
174 #: username/login
175 self.user = None
176
177 if self.account and not self.account.canUse(): self.account = None
178 if self.account:
179 self.user, data = self.account.selectAccount()
180 #: Browser instance, see `network.Browser`
181 self.req = self.account.getAccountRequest(self.user)
182 self.chunkLimit = -1 # chunk limit, -1 for unlimited
183 #: enables resume (will be ignored if server dont accept chunks)
184 self.resumeDownload = True
185 self.multiDL = True #every hoster with account should provide multiple downloads
186 #: premium status
187 self.premium = self.account.isPremium(self.user)
188 else:
189 self.req = pyfile.m.core.requestFactory.getRequest(self.__name__)
190
191 #: associated pyfile instance, see `PyFile`
192 self.pyfile = pyfile
193 self.thread = None # holds thread in future
194
195 #: location where the last call to download was saved
196 self.lastDownload = ""
197 #: re match of the last call to `checkDownload`
198 self.lastCheck = None
199 #: js engine, see `JsEngine`
200 self.js = self.core.js
201 self.cTask = None #captcha task
202
203 self.retries = 0 # amount of retries already made
204 self.html = None # some plugins store html code here
205
206 self.init()
207
208 def getChunkCount(self):
209 if self.chunkLimit <= 0:

Callers

nothing calls this directly

Calls 4

initMethod · 0.95
getAccountPluginMethod · 0.80
getRequestMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected