summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/EasybytezCom.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-08 00:29:57 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-09-14 11:02:23 +0200
commit68d662e689cd42687341c550fb6ebb74e6968d21 (patch)
tree486cef41bd928b8db704894233b2cef94a6e346f /module/plugins/accounts/EasybytezCom.py
parentsave_join -> safe_join & save_path -> safe_filename (diff)
downloadpyload-68d662e689cd42687341c550fb6ebb74e6968d21.tar.xz
module -> pyload
Diffstat (limited to 'module/plugins/accounts/EasybytezCom.py')
-rw-r--r--module/plugins/accounts/EasybytezCom.py61
1 files changed, 0 insertions, 61 deletions
diff --git a/module/plugins/accounts/EasybytezCom.py b/module/plugins/accounts/EasybytezCom.py
deleted file mode 100644
index 3b8517686..000000000
--- a/module/plugins/accounts/EasybytezCom.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-
-import re
-from time import mktime, strptime, gmtime
-
-from module.plugins.Account import Account
-from module.plugins.internal.SimpleHoster import parseHtmlForm
-from module.utils import parseFileSize
-
-
-class EasybytezCom(Account):
- __name__ = "EasybytezCom"
- __type__ = "account"
- __version__ = "0.04"
-
- __description__ = """EasyBytez.com account plugin"""
- __author_name__ = "zoidberg"
- __author_mail__ = "zoidberg@mujmail.cz"
-
- VALID_UNTIL_PATTERN = r'Premium account expire:</TD><TD><b>([^<]+)</b>'
- TRAFFIC_LEFT_PATTERN = r'<TR><TD>Traffic available today:</TD><TD><b>(?P<S>[^<]+)</b>'
-
-
- def loadAccountInfo(self, user, req):
- html = req.load("http://www.easybytez.com/?op=my_account", decode=True)
-
- validuntil = trafficleft = None
- premium = False
-
- m = re.search(self.VALID_UNTIL_PATTERN, html)
- if m:
- try:
- self.logDebug("Expire date: " + m.group(1))
- validuntil = mktime(strptime(m.group(1), "%d %B %Y"))
- except Exception, e:
- self.logError(e)
- if validuntil > mktime(gmtime()):
- premium = True
- trafficleft = -1
- else:
- m = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- if m:
- trafficleft = m.group(1)
- if "Unlimited" in trafficleft:
- trafficleft = -1
- else:
- trafficleft = parseFileSize(trafficleft) / 1024
-
- return {"validuntil": validuntil, "trafficleft": trafficleft, "premium": premium}
-
- def login(self, user, data, req):
- html = req.load('http://www.easybytez.com/login.html', decode=True)
- action, inputs = parseHtmlForm('name="FL"', html)
- inputs.update({"login": user,
- "password": data['password'],
- "redirect": "http://www.easybytez.com/"})
-
- html = req.load(action, post=inputs, decode=True)
-
- if 'Incorrect Login or Password' in html or '>Error<' in html:
- self.wrongPassword()