summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2011-12-10 00:12:58 +0100
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2011-12-10 00:12:58 +0100
commit68248f809d1cad27c10bac1e84afb52d5bf49ed0 (patch)
treefc33c921676429883175da3fd07a39669b2b4b30 /module/plugins/accounts
parentmultishare.cz premium (diff)
downloadpyload-68248f809d1cad27c10bac1e84afb52d5bf49ed0.tar.xz
megaupload #451, uploadedto #443
Diffstat (limited to 'module/plugins/accounts')
-rw-r--r--module/plugins/accounts/MultishareCz.py2
-rw-r--r--module/plugins/accounts/UploadedTo.py8
2 files changed, 6 insertions, 4 deletions
diff --git a/module/plugins/accounts/MultishareCz.py b/module/plugins/accounts/MultishareCz.py
index 6b5402c08..cc3e430af 100644
--- a/module/plugins/accounts/MultishareCz.py
+++ b/module/plugins/accounts/MultishareCz.py
@@ -39,7 +39,7 @@ class MultishareCz(Account):
html = req.load("http://www.multishare.cz/profil/", decode = True)
found = re.search(self.TRAFFIC_LEFT_PATTERN, html)
- trafficleft = parseFileSize(found.group('S'), found.group('U')) if found else 0
+ trafficleft = parseFileSize(found.group('S'), found.group('U')) / 1024 if found else 0
self.premium = True if trafficleft else False
html = req.load("http://www.multishare.cz/", decode = True)
diff --git a/module/plugins/accounts/UploadedTo.py b/module/plugins/accounts/UploadedTo.py
index 0bc7c2fd0..b4d194396 100644
--- a/module/plugins/accounts/UploadedTo.py
+++ b/module/plugins/accounts/UploadedTo.py
@@ -23,7 +23,7 @@ from time import time
class UploadedTo(Account):
__name__ = "UploadedTo"
- __version__ = "0.2"
+ __version__ = "0.21"
__type__ = "account"
__description__ = """ul.to account plugin"""
__author_name__ = ("mkaay")
@@ -45,8 +45,10 @@ class UploadedTo(Account):
if raw_valid == "unlimited":
validuntil = -1
else:
- raw_valid = re.findall(r"\d+", raw_valid)
- validuntil = time() + 24 * 60 * 60 * int(raw_valid[0]) + 60 * 60 * int(raw_valid[1])
+ raw_valid = re.findall(r"(\d+) (weeks|days|hours)", raw_valid)
+ validuntil = time()
+ for n, u in raw_valid:
+ validuntil += 3600 * int(n) * {"weeks": 168, "days": 24, "hours": 1}[u]
return {"validuntil":validuntil, "trafficleft":traffic, "maxtraffic":50*1024*1024}
else: