From 3d27f5ccee412d38102873a5b02e3f236375eb97 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 16 Dec 2014 03:44:15 +0100 Subject: Update plugins (2) --- module/plugins/hoster/ShareonlineBiz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/ShareonlineBiz.py') diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 1cb651b12..c40e8560f 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -48,7 +48,7 @@ class ShareonlineBiz(SimpleHoster): if field[1] == "OK": info['fileid'] = field[0] info['status'] = 2 - info['name'] = field[2] + info['name'] = field[2] info['size'] = field[3] #: in bytes info['md5'] = field[4].strip().lower().replace("\n\n", "") #: md5 -- cgit v1.2.3 From 4e9c8f7ab1269966a9eac9e1b6363f5458f9f970 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 18 Dec 2014 16:07:21 +0100 Subject: Update checkFile routine in some hoster plugins --- module/plugins/hoster/ShareonlineBiz.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'module/plugins/hoster/ShareonlineBiz.py') diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index c40e8560f..dc3d5093c 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -14,7 +14,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ShareonlineBiz(SimpleHoster): __name__ = "ShareonlineBiz" __type__ = "hoster" - __version__ = "0.44" + __version__ = "0.45" __pattern__ = r'https?://(?:www\.)?(share-online\.biz|egoshare\.com)/(download\.php\?id=|dl/)(?P\w+)' @@ -108,17 +108,14 @@ class ShareonlineBiz(SimpleHoster): def checkFile(self): - # check download + super(ShareonlineBiz, self).checkFile() + check = self.checkDownload({ - 'empty' : re.compile(r"^$"), 'cookie': re.compile(r'
Share-Online") }) - if check == "empty": - self.fail(_("Empty file")) - - elif check == "cookie": + if check == "cookie": self.invalidCaptcha() self.retry(5, 60, _("Cookie failure")) -- cgit v1.2.3 From 7979d0833573a107baae8c45330b8b5874630a76 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 4 Jan 2015 20:26:13 +0100 Subject: Spare code improvements --- module/plugins/hoster/ShareonlineBiz.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/ShareonlineBiz.py') diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index dc3d5093c..bbf75c94a 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -14,7 +14,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ShareonlineBiz(SimpleHoster): __name__ = "ShareonlineBiz" __type__ = "hoster" - __version__ = "0.45" + __version__ = "0.46" __pattern__ = r'https?://(?:www\.)?(share-online\.biz|egoshare\.com)/(download\.php\?id=|dl/)(?P\w+)' @@ -28,6 +28,8 @@ class ShareonlineBiz(SimpleHoster): URL_REPLACEMENTS = [(__pattern__ + ".*", "http://www.share-online.biz/dl/\g")] + CHECK_TRAFFIC = True + RECAPTCHA_KEY = "6LdatrsSAAAAAHZrB70txiV5p-8Iv8BtVxlTtjKX" ERROR_INFO_PATTERN = r'

Information:

\s*
\s*(.*?)' @@ -125,8 +127,6 @@ class ShareonlineBiz(SimpleHoster): def handlePremium(self): #: should be working better loading (account) api internally - self.account.getAccountInfo(self.user, True) - html = self.load("http://api.share-online.biz/account.php", {"username": self.user, "password": self.account.accounts[self.user]['password'], "act": "download", "lid": self.info['fileid']}) -- cgit v1.2.3 From fd105f8e51768ec1943cda2375bdfdbe5b0a3951 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 9 Jan 2015 00:35:51 +0100 Subject: "New Year" Update: hoster plugins --- module/plugins/hoster/ShareonlineBiz.py | 36 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'module/plugins/hoster/ShareonlineBiz.py') diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index bbf75c94a..636e5824d 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -14,7 +14,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ShareonlineBiz(SimpleHoster): __name__ = "ShareonlineBiz" __type__ = "hoster" - __version__ = "0.46" + __version__ = "0.47" __pattern__ = r'https?://(?:www\.)?(share-online\.biz|egoshare\.com)/(download\.php\?id=|dl/)(?P\w+)' @@ -32,7 +32,7 @@ class ShareonlineBiz(SimpleHoster): RECAPTCHA_KEY = "6LdatrsSAAAAAHZrB70txiV5p-8Iv8BtVxlTtjKX" - ERROR_INFO_PATTERN = r'

Information:

\s*
\s*(.*?)' + ERROR_PATTERN = r'

Information:

\s*
\s*(.*?)' @classmethod @@ -88,12 +88,12 @@ class ShareonlineBiz(SimpleHoster): self.fail(_("No valid captcha solution received")) - def handleFree(self): - self.html = self.load(self.pyfile.url, cookies=True) #: refer, stuff - + def handleFree(self, pyfile): self.wait(3) - self.html = self.load("%s/free/" % self.pyfile.url, post={"dl_free": "1", "choice": "free"}, decode=True) + self.html = self.load("%s/free/" % pyfile.url, + post={'dl_free': "1", 'choice': "free"}, + decode=True) self.checkErrors() @@ -110,12 +110,8 @@ class ShareonlineBiz(SimpleHoster): def checkFile(self): - super(ShareonlineBiz, self).checkFile() - - check = self.checkDownload({ - 'cookie': re.compile(r'
Share-Online") - }) + check = self.checkDownload({'cookie': re.compile(r'
Share-Online")}) if check == "cookie": self.invalidCaptcha() @@ -125,11 +121,15 @@ class ShareonlineBiz(SimpleHoster): self.invalidCaptcha() self.retry(5, 5 * 60, _("Download failed")) + return super(ShareonlineBiz, self).checkFile() + - def handlePremium(self): #: should be working better loading (account) api internally + def handlePremium(self, pyfile): #: should be working better loading (account) api internally html = self.load("http://api.share-online.biz/account.php", - {"username": self.user, "password": self.account.accounts[self.user]['password'], - "act": "download", "lid": self.info['fileid']}) + get={'username': self.user, + 'password': self.account.getAccountData(self.user)['password'], + 'act' : "download", + 'lid' : self.info['fileid']}) self.api_data = dlinfo = {} @@ -142,8 +142,8 @@ class ShareonlineBiz(SimpleHoster): if not dlinfo['status'] == "online": self.offline() else: - self.pyfile.name = dlinfo['name'] - self.pyfile.size = int(dlinfo['size']) + pyfile.name = dlinfo['name'] + pyfile.size = int(dlinfo['size']) dlLink = dlinfo['url'] @@ -163,7 +163,7 @@ class ShareonlineBiz(SimpleHoster): errmsg = m.group(1).lower() try: - self.logError(errmsg, re.search(self.ERROR_INFO_PATTERN, self.html).group(1)) + self.logError(errmsg, re.search(self.ERROR_PATTERN, self.html).group(1)) except: self.logError("Unknown error occurred", errmsg) -- cgit v1.2.3 From e1baccf1ec914563d3b2b845906cce024e7cd3b1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 13 Jan 2015 23:14:50 +0100 Subject: Replace 'except' with 'except Exception' --- module/plugins/hoster/ShareonlineBiz.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/ShareonlineBiz.py') diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 636e5824d..5918726f5 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -164,7 +164,7 @@ class ShareonlineBiz(SimpleHoster): try: self.logError(errmsg, re.search(self.ERROR_PATTERN, self.html).group(1)) - except: + except Exception: self.logError("Unknown error occurred", errmsg) if errmsg is "invalid": -- cgit v1.2.3 From cf4ded052964047de88d676045329b8fa4fca2dc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 22 Jan 2015 21:31:19 +0100 Subject: Update plugins after CaptchaService changes --- module/plugins/hoster/ShareonlineBiz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/ShareonlineBiz.py') diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 5918726f5..6f49711b8 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -14,7 +14,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class ShareonlineBiz(SimpleHoster): __name__ = "ShareonlineBiz" __type__ = "hoster" - __version__ = "0.47" + __version__ = "0.48" __pattern__ = r'https?://(?:www\.)?(share-online\.biz|egoshare\.com)/(download\.php\?id=|dl/)(?P\w+)' @@ -69,7 +69,7 @@ class ShareonlineBiz(SimpleHoster): recaptcha = ReCaptcha(self) for _i in xrange(5): - challenge, response = recaptcha.challenge(self.RECAPTCHA_KEY) + response, challenge = recaptcha.challenge(self.RECAPTCHA_KEY) m = re.search(r'var wait=(\d+);', self.html) self.setWait(int(m.group(1)) if m else 30) -- cgit v1.2.3 From 79725268402043906f619f7c09e848e02ab8a17b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 31 Jan 2015 22:00:59 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/ShareonlineBiz.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/ShareonlineBiz.py') diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 6f49711b8..e00bf5ada 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -97,9 +97,8 @@ class ShareonlineBiz(SimpleHoster): self.checkErrors() - res = self.handleCaptcha() - - download_url = res.decode("base64") + res = self.handleCaptcha() + download_url = res.decode('base64') if not download_url.startswith("http://"): self.error(_("Wrong download url")) -- cgit v1.2.3