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

Method grab_info

module/plugins/accounts/FilerNet.py:25–48  ·  view source on GitHub ↗
(self, user, password, data)

Source from the content-addressed store, hash-verified

23 FREE_PATTERN = r'Account Status</th>\s*<td>\s*Free'
24
25 def grab_info(self, user, password, data):
26 html = self.load("https://filer.net/profile")
27
28 #: Free user
29 if re.search(self.FREE_PATTERN, html):
30 return {'premium': False,
31 'validuntil': None,
32 'trafficleft': None}
33
34 until = re.search(self.VALID_UNTIL_PATTERN, html)
35 traffic = re.search(self.TRAFFIC_LEFT_PATTERN, html)
36
37 if until and traffic:
38 validuntil = time.mktime(time.strptime(until.group(1), "%d.%m.%Y, %H:%M:%S"))
39 trafficleft = self.parse_traffic(traffic.group(1), traffic.group(2))
40 return {'premium': True,
41 'validuntil': validuntil,
42 'trafficleft': trafficleft}
43
44 else:
45 self.log_error(_("Unable to retrieve account information"))
46 return {'premium': False,
47 'validuntil': None,
48 'trafficleft': None}
49
50 def signin(self, user, password, data):
51 html = self.load("https://filer.net/login")

Callers

nothing calls this directly

Calls 5

parse_trafficMethod · 0.80
log_errorMethod · 0.80
_Function · 0.50
loadMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected