(self, user, password, data)
| 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") |
nothing calls this directly
no test coverage detected