diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2012-10-20 23:13:17 +0200 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2012-10-20 23:13:17 +0200 |
commit | f4ff2b29cc39105de2845cdfbf90a4517e33bd86 (patch) | |
tree | 6b12ab6745f39fb7c5e05256705472cd23a49738 /module/plugins | |
parent | small plugin fixes, closed #694, #695 (diff) | |
download | pyload-f4ff2b29cc39105de2845cdfbf90a4517e33bd86.tar.xz |
rapidgator.net, shareonline.biz - closed #701
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hoster/RapidgatorNet.py | 34 | ||||
-rw-r--r-- | module/plugins/hoster/ShareonlineBiz.py | 11 |
2 files changed, 32 insertions, 13 deletions
diff --git a/module/plugins/hoster/RapidgatorNet.py b/module/plugins/hoster/RapidgatorNet.py index f0d64cae1..b7e382c4e 100644 --- a/module/plugins/hoster/RapidgatorNet.py +++ b/module/plugins/hoster/RapidgatorNet.py @@ -29,7 +29,7 @@ class RapidgatorNet(SimpleHoster): __name__ = "RapidgatorNet" __type__ = "hoster" __pattern__ = r"http://(?:www\.)?(rapidgator.net)/file/(\d+)" - __version__ = "0.11" + __version__ = "0.12" __description__ = """rapidgator.net""" __author_name__ = ("zoidberg","chrox") @@ -43,31 +43,45 @@ class RapidgatorNet(SimpleHoster): RECAPTCHA_KEY_PATTERN = r'"http://api.recaptcha.net/challenge?k=(.*?)"' ADSCAPTCHA_SRC_PATTERN = r'(http://api.adscaptcha.com/Get.aspx[^"\']*)' SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' + + def setup(self): + self.resumeDownload = False + self.multiDL = False + self.sid = None + self.chunkLimit = 1 + self.req.setOption("timeout", 120) + + def process(self, pyfile): + if self.account: + self.sid = self.account.getAccountData(self.user).get('SID', None) + + if self.sid: + self.handlePremium() + else: + self.handleFree() def getAPIResponse(self, cmd): try: json = self.load('%s/%s' % (self.API_URL, cmd), - get = {'sid': self.account.getAccountData(self.user).get('SID'), + get = {'sid': self.sid, 'url': self.pyfile.url}, decode = True) - self.logDebug('API:%s' % cmd, json) + self.logDebug('API:%s' % cmd, json, "SID: %s" % self.sid) json = json_loads(json) status = json['response_status'] msg = json['response_details'] except BadHeader, e: - self.logError('API:%s' % cmd, e) + self.logError('API:%s' % cmd, e, "SID: %s" % self.sid) status = e.code msg = e if status == 200: return json['response'] - elif status == 401: - self.account.relogin(self.user) - self.retry() elif status == 423: self.account.empty(self.user) self.retry() else: - self.fail(msg) + self.account.relogin(self.user) + self.retry(wait_time=60) def handlePremium(self): #self.logDebug("ACCOUNT_DATA", self.account.getAccountData(self.user)) @@ -76,9 +90,13 @@ class RapidgatorNet(SimpleHoster): self.pyfile.name = self.api_data['filename'] self.pyfile.size = self.api_data['size'] url = self.getAPIResponse('download')['url'] + self.multiDL = True self.download(url) def handleFree(self): + self.html = self.load(self.pyfile.url, decode = True) + self.getFileInfo() + if "You can download files up to 500 MB in free mode" in self.html \ or "This file can be downloaded by premium only" in self.html: self.fail("Premium account needed for download") diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index e47aa0e5e..383f933ff 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -17,7 +17,7 @@ def getInfo(urls): for chunk in chunks(urls, 90): api_param_file = {"links": "\n".join(x.replace("http://www.share-online.biz/dl/","").rstrip("/") for x in chunk)} #api only supports old style links - src = getURL(api_url_base, post=api_param_file) + src = getURL(api_url_base, post=api_param_file, decode=True) result = [] for i, res in enumerate(src.split("\n")): if not res: @@ -43,7 +43,7 @@ class ShareonlineBiz(Hoster): __name__ = "ShareonlineBiz" __type__ = "hoster" __pattern__ = r"http://[\w\.]*?(share\-online\.biz|egoshare\.com)/(download.php\?id\=|dl/)[\w]+" - __version__ = "0.34" + __version__ = "0.35" __description__ = """Shareonline.biz Download Hoster""" __author_name__ = ("spoob", "mkaay", "zoidberg") __author_mail__ = ("spoob@pyload.org", "mkaay@mkaay.de", "zoidberg@mujmail.cz") @@ -57,7 +57,8 @@ class ShareonlineBiz(Hoster): self.file_id = re.search(r"(id\=|/dl/)([a-zA-Z0-9]+)", self.pyfile.url).group(2) self.pyfile.url = "http://www.share-online.biz/dl/" + self.file_id - self.resumeDownload = self.multiDL = self.premium + self.resumeDownload = self.premium + self.multiDL = False #self.chunkLimit = 1 self.check_data = None @@ -84,7 +85,7 @@ class ShareonlineBiz(Hoster): def downloadAPIData(self): api_url_base = "http://api.share-online.biz/linkcheck.php?md5=1" api_param_file = {"links": self.pyfile.url.replace("http://www.share-online.biz/dl/","")} #api only supports old style links - src = self.load(api_url_base, cookies=False, post=api_param_file) + src = self.load(api_url_base, cookies=False, post=api_param_file, decode=True) fields = src.split(";") self.api_data = {"fileid": fields[0], @@ -139,7 +140,6 @@ class ShareonlineBiz(Hoster): self.retry(5, 60, "Cookie failure") elif check == "fail": self.retry(5, 300, "Download failed") - def checkErrors(self): found = re.search(r"/failure/(.*?)/1", self.req.lastEffectiveURL) @@ -182,6 +182,7 @@ class ShareonlineBiz(Hoster): if dlLink == "server_under_maintenance": self.tempoffline() else: + self.multiDL = True self.download(dlLink) def checksum(self, local_file): |