summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-11-16 17:50:39 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-11-16 17:50:39 +0100
commitad274af55174570bd2e6e7db194e87007a13c5c7 (patch)
tree30b6799eec09fd1afd4e3a074d4e96805394be78 /module/plugins/hoster
parentforgot to remove some debug prints (diff)
downloadpyload-ad274af55174570bd2e6e7db194e87007a13c5c7.tar.xz
closed #153
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/MegauploadCom.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py
index 7993233dc..a16369784 100644
--- a/module/plugins/hoster/MegauploadCom.py
+++ b/module/plugins/hoster/MegauploadCom.py
@@ -56,23 +56,27 @@ class MegauploadCom(Hoster):
def setup(self):
self.html = [None, None]
+
if self.account:
- self.multiDL = True
- self.req.canContinue = True
+ self.premium = self.account.getAccountInfo(self.user)["premium"]
+ if self.premium:
+ self.multiDL = True
+ self.req.canContinue = True
else:
self.multiDL = False
self.api = {}
def process(self, pyfile):
- if not self.account:
+ if not self.account or not self.premium:
self.download_html()
self.download_api()
if not self.file_exists():
self.offline()
-
- self.setWait(45)
+
+ time = self.get_wait_time()
+ self.setWait(time)
self.wait()
pyfile.name = self.get_file_name()
@@ -88,7 +92,8 @@ class MegauploadCom(Hoster):
self.log.info(_("Megaupload: waiting %d minutes") % int(wait))
self.setWait(int(wait)*60, True)
self.wait()
- self.req.clearCookies()
+ if not self.premium:
+ self.req.clearCookies()
self.process(pyfile)
else:
self.download_api()
@@ -169,6 +174,13 @@ class MegauploadCom(Hoster):
else:
return self.api["name"]
+ def get_wait_time(self):
+ time = re.search(r"count=(\d+);", self.html[1])
+ if time:
+ return time.group(1)
+ else:
+ return 45
+
def file_exists(self):
#self.download_html()
if re.search(r"Unfortunately, the link you have clicked is not available.", self.html[0]) is not None or \