summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/accounts/MegasharesCom.py
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-07-23 20:22:42 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-07-23 20:40:59 +0200
commit4a81799278ae003bfbd7897f7bcd1ef46642d953 (patch)
tree59e580fc761103cfacd9190bc9c55a5a01367f47 /pyload/plugins/accounts/MegasharesCom.py
parentlittle cleanup, added some tests (diff)
downloadpyload-4a81799278ae003bfbd7897f7bcd1ef46642d953.tar.xz
Fixed PEP 8 violations in Accounts
(cherry picked from commit f5535809bebc6cc343475704832c8fd8674d2d06) Conflicts: pyload/plugins/accounts/AlldebridCom.py pyload/plugins/accounts/Premium4Me.py pyload/plugins/accounts/PremiumizeMe.py pyload/plugins/accounts/RealdebridCom.py
Diffstat (limited to 'pyload/plugins/accounts/MegasharesCom.py')
-rw-r--r--pyload/plugins/accounts/MegasharesCom.py34
1 files changed, 18 insertions, 16 deletions
diff --git a/pyload/plugins/accounts/MegasharesCom.py b/pyload/plugins/accounts/MegasharesCom.py
index 91601fc95..e7d5f9ca9 100644
--- a/pyload/plugins/accounts/MegasharesCom.py
+++ b/pyload/plugins/accounts/MegasharesCom.py
@@ -1,9 +1,11 @@
# -*- coding: utf-8 -*-
-from module.plugins.Account import Account
import re
from time import mktime, strptime
+from module.plugins.Account import Account
+
+
class MegasharesCom(Account):
__name__ = "MegasharesCom"
__version__ = "0.02"
@@ -11,32 +13,32 @@ class MegasharesCom(Account):
__description__ = """megashares.com account plugin"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
-
+
VALID_UNTIL_PATTERN = r'<p class="premium_info_box">Period Ends: (\w{3} \d{1,2}, \d{4})</p>'
-
+
def loadAccountInfo(self, user, req):
#self.relogin(user)
- html = req.load("http://d01.megashares.com/myms.php", decode = True)
-
+ html = req.load("http://d01.megashares.com/myms.php", decode=True)
+
premium = False if '>Premium Upgrade<' in html else True
-
+
validuntil = trafficleft = -1
- try:
+ try:
timestr = re.search(self.VALID_UNTIL_PATTERN, html).group(1)
self.logDebug(timestr)
validuntil = mktime(strptime(timestr, "%b %d, %Y"))
except Exception, e:
- self.logError(e)
-
+ self.logError(e)
+
return {"validuntil": validuntil, "trafficleft": -1, "premium": premium}
-
+
def login(self, user, data, req):
- html = req.load('http://d01.megashares.com/myms_login.php', post = {
- "httpref": "",
- "myms_login": "Login",
+ html = req.load('http://d01.megashares.com/myms_login.php', post={
+ "httpref": "",
+ "myms_login": "Login",
"mymslogin_name": user,
"mymspassword": data['password']
- }, decode = True)
-
+ }, decode=True)
+
if not '<span class="b ml">%s</span>' % user in html:
- self.wrongPassword() \ No newline at end of file
+ self.wrongPassword()