summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2011-02-03 19:31:34 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2011-02-03 19:31:34 +0100
commitccadf3260e6113fc93e1f50ff8755bb0c1c7daa8 (patch)
tree2f4ec489a7ff370fddb227c986edd0db87c16b09
parentsmall bugfix (diff)
downloadpyload-ccadf3260e6113fc93e1f50ff8755bb0c1c7daa8.tar.xz
share-online.biz free account fix
-rw-r--r--module/plugins/Account.py4
-rw-r--r--module/plugins/accounts/ShareonlineBiz.py9
-rw-r--r--module/plugins/hoster/ShareonlineBiz.py10
-rw-r--r--testlinks.txt2
4 files changed, 18 insertions, 7 deletions
diff --git a/module/plugins/Account.py b/module/plugins/Account.py
index 6eda09077..ae9038eed 100644
--- a/module/plugins/Account.py
+++ b/module/plugins/Account.py
@@ -111,6 +111,10 @@ class Account():
data.update(self.infos[name])
return data
+
+ def isPremium(self, user):
+ info = self.getAccountInfo(user)
+ return info["premium"]
def loadAccountInfo(self, name, req=None):
return {
diff --git a/module/plugins/accounts/ShareonlineBiz.py b/module/plugins/accounts/ShareonlineBiz.py
index c5e4477be..d872ba086 100644
--- a/module/plugins/accounts/ShareonlineBiz.py
+++ b/module/plugins/accounts/ShareonlineBiz.py
@@ -36,8 +36,15 @@ class ShareonlineBiz(Account):
validuntil = int(mktime(strptime(validuntil.group(1), "%m/%d/%y")))
else:
validuntil = -1
+
+ acctype = re.search(r'<td align="left" ><b>Your Package:</b></td>\s*<td align="left">\s*<b>(.*?)</b>\s*</td>', src)
+ if acctype:
+ if acctype.group(1) == "Collector account (free)":
+ premium = False
+ else:
+ premium = True
- tmp = {"validuntil":validuntil, "trafficleft":-1}
+ tmp = {"validuntil": validuntil, "trafficleft": -1, "premium": premium}
return tmp
def login(self, user, data, req):
diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py
index 8ed9cdce8..78329e48a 100644
--- a/module/plugins/hoster/ShareonlineBiz.py
+++ b/module/plugins/hoster/ShareonlineBiz.py
@@ -46,7 +46,7 @@ class ShareonlineBiz(Hoster):
def setup(self):
#self.req.canContinue = self.multiDL = True if self.account else False
# range request not working?
- self.multiDL = True if self.account else False
+ self.multiDL = True if self.account and self.account.isPremium(self.user) else False
def process(self, pyfile):
self.convertURL()
@@ -75,7 +75,7 @@ class ShareonlineBiz(Hoster):
def downloadHTML(self):
self.html = self.load(self.pyfile.url, cookies=True)
- if not self.account:
+ if not self.account or not self.account.isPremium(self.user):
self.html = self.load("%s/free/" % self.pyfile.url, post={"dl_free":"1"}, cookies=True)
if re.search(r"/failure/full/1", self.req.lastEffectiveURL):
self.setWait(120)
@@ -94,7 +94,7 @@ class ShareonlineBiz(Hoster):
if r"Der Download ist Ihnen zu langsam" not in self.html and r"The download is too slow for you" not in self.html:
self.fail("Plugin defect. Save dumps and report.")
- m = re.search("var timeout='(\d+)';", self.html[1])
+ m = re.search("var wait=(\d+);", self.html[1])
wait_time = int(m.group(1)) if m else 30
self.setWait(wait_time)
self.log.debug("%s: Waiting %d seconds." % (self.__name__, wait_time))
@@ -108,7 +108,7 @@ class ShareonlineBiz(Hoster):
return True
def convertURL(self):
- if self.account:
+ if self.account and self.account.isPremium(self.user):
self.pyfile.url = self.pyfile.url.replace("http://www.share-online.biz/dl/", "http://www.share-online.biz/download.php?id=")
self.pyfile.url = self.pyfile.url.replace("http://www.share-online.biz/dl/", "http://share-online.biz/download.php?id=")
else:
@@ -119,7 +119,7 @@ class ShareonlineBiz(Hoster):
def getFileUrl(self):
""" returns the absolute downloadable filepath
"""
- if self.account:
+ if self.account and self.account.isPremium(self.user):
try:
return re.search('loadfilelink\.decode\("(.*?)"\);', self.html, re.S).group(1)
except:
diff --git a/testlinks.txt b/testlinks.txt
index 9254d4924..428cf63ea 100644
--- a/testlinks.txt
+++ b/testlinks.txt
@@ -15,7 +15,7 @@ http://www.duckload.com/dl/QggW2
http://files.mail.ru/32EW66
http://www.fileserve.com/file/MxjZXjX
http://www.4shared.com/file/-O5CBhQV/random.html
-http://hotfile.com/links/101569859/08d24d3/random.bin.html
+http://hotfile.com/dl/101569859/2e01f04/random.bin.html
http://www.megaupload.com/?d=1JZLOP3B
http://www.share.cx/files/235687689252/random.bin.html
http://www.share-online.biz/download.php?id=PTCOX1GL6XAH