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

Method handle_multi

module/plugins/internal/XFSHoster.py:118–169  ·  view source on GitHub ↗
(self, pyfile)

Source from the content-addressed store, hash-verified

116 return self.handle_free(pyfile)
117
118 def handle_multi(self, pyfile):
119 if not self.account:
120 self.fail(_("Only registered or premium users can use url leech feature"))
121
122 #: Only tested with easybytez.com
123 self.data = self.load("http://www.%s/" % self.PLUGIN_DOMAIN)
124
125 action, inputs = self.parse_html_form()
126
127 upload_id = "%012d" % int(random.random() * 10 ** 12)
128 action += upload_id + "&js_on=1&utype=prem&upload_type=url"
129
130 inputs['tos'] = '1'
131 inputs['url_mass'] = pyfile.url
132 inputs['up1oad_type'] = 'url'
133
134 self.log_debug(action, inputs)
135
136 #: Wait for file to upload to easybytez.com
137 self.req.setOption("timeout", 600)
138
139 self.data = self.load(action, post=inputs)
140
141 self.check_errors()
142
143 action, inputs = self.parse_html_form('F1')
144 if not inputs:
145 self.retry(msg=self.info.get('error') or _("TEXTAREA F1 not found"))
146
147 self.log_debug(inputs)
148
149 stmsg = inputs['st']
150
151 if stmsg == 'OK':
152 self.data = self.load(action, post=inputs)
153
154 elif 'Can not leech file' in stmsg:
155 self.retry(20, 3 * 60, _("Can not leech file"))
156
157 elif 'today' in stmsg:
158 self.retry(wait=seconds_to_midnight(),
159 msg=_("You've used all Leech traffic today"))
160
161 else:
162 self.fail(stmsg)
163
164 #: Get easybytez.com link for uploaded file
165 m = search_pattern(self.LINK_LEECH_PATTERN, self.data)
166 if m is None:
167 self.error(_("LINK_LEECH_PATTERN not found"))
168
169 self.link = self.load(m.group(1), just_header=True).get('location')
170
171 def _post_parameters(self):
172 if self.FORM_PATTERN or self.FORM_INPUTS_MAP:

Callers

nothing calls this directly

Calls 12

seconds_to_midnightFunction · 0.85
search_patternFunction · 0.85
parse_html_formMethod · 0.80
log_debugMethod · 0.80
setOptionMethod · 0.80
_Function · 0.50
failMethod · 0.45
loadMethod · 0.45
check_errorsMethod · 0.45
retryMethod · 0.45
getMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected