diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-12-30 18:20:44 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-12-30 18:20:44 +0100 |
commit | 371ed3e634a9de63d9a5a707a033541272f67437 (patch) | |
tree | c382ebc95c970adab002339063a789c62dcec10f | |
parent | improved performance for wlan (diff) | |
download | pyload-371ed3e634a9de63d9a5a707a033541272f67437.tar.xz |
MU premium lifetime fix
-rw-r--r-- | module/network/HTTPChunk.py | 7 | ||||
-rw-r--r-- | module/plugins/Plugin.py | 8 | ||||
-rw-r--r-- | module/plugins/accounts/MegauploadCom.py | 5 |
3 files changed, 15 insertions, 5 deletions
diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py index dee185342..1cc9841a6 100644 --- a/module/network/HTTPChunk.py +++ b/module/network/HTTPChunk.py @@ -182,10 +182,9 @@ class HTTPChunk(HTTPRequest): if self.p.bucket: sleep(self.p.bucket.consumed(size)) - else: #@TODO nice to have: traffic sharping algr. which calculates sleep time to reduce cpu load - if size < 5000: - #sleep if chunk size gets low, to avoid many function calls and hope chunksize gets bigger - sleep(0.007) + elif size < 5000: #@TODO nice to have: traffic sharping algr. which calculates sleep time to reduce cpu load + #sleep if chunk size gets low, to avoid many function calls and hope chunksize gets bigger + sleep(0.007) if self.range and self.arrived > (self.range[1]-self.range[0]): return 0 #close if we have enough data diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index 8a26996d0..d9ca4e5d9 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -111,6 +111,8 @@ class Plugin(object): self.lastCheck = None #re match of last checked matched self.js = self.core.js # js engine + self.html = None #some plugins store html code here + #self.setup() def getChunkCount(self): @@ -388,4 +390,8 @@ class Plugin(object): del self.pyfile if hasattr(self, "req"): self.req.close() - del self.req
\ No newline at end of file + del self.req + if hasattr(self, "thread"): + del self.thread + if hasattr(self, "html"): + del self.html
\ No newline at end of file diff --git a/module/plugins/accounts/MegauploadCom.py b/module/plugins/accounts/MegauploadCom.py index 2f33e791b..df539507c 100644 --- a/module/plugins/accounts/MegauploadCom.py +++ b/module/plugins/accounts/MegauploadCom.py @@ -33,6 +33,8 @@ class MegauploadCom(Account): def loadAccountInfo(self, user, req): page = req.load("http://www.megaupload.com/?c=account") + open("mu.html", "wb").write(page) + free = re.findall(r"Account type:\s*</div>\s*<div class=\"acc_txt_bl2\">\s*<b>Regular</b>",page,re.IGNORECASE+re.MULTILINE) if free: return {"validuntil": -1, "trafficleft":-1, "premium": False} @@ -40,6 +42,9 @@ class MegauploadCom(Account): if 'id="directdownloadstxt">Activate' in page: self.core.log.warning(_("Activate direct Download in your MegaUpload Account")) + if "<b>Lifetime Platinum</b>" in page: + return {"validuntil": -1, "trafficleft": -1, "premium": True} + valid = re.search(r"(\d+) days remaining", page).group(1) valid = time()+ 60 * 60 * 24 * int(valid) |