diff options
Diffstat (limited to 'pyload/plugins/hoster/LuckyShareNet.py')
-rw-r--r-- | pyload/plugins/hoster/LuckyShareNet.py | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/pyload/plugins/hoster/LuckyShareNet.py b/pyload/plugins/hoster/LuckyShareNet.py index 32f1c03bf..31de417b7 100644 --- a/pyload/plugins/hoster/LuckyShareNet.py +++ b/pyload/plugins/hoster/LuckyShareNet.py @@ -9,17 +9,18 @@ from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class LuckyShareNet(SimpleHoster): - __name__ = "LuckyShareNet" - __type__ = "hoster" - __version__ = "0.02" + __name__ = "LuckyShareNet" + __type__ = "hoster" + __version__ = "0.03" - __pattern__ = r'https?://(?:www\.)?luckyshare.net/(?P<ID>\d{10,})' + __pattern__ = r'https?://(?:www\.)?luckyshare\.net/(?P<ID>\d{10,})' __description__ = """LuckyShare.net hoster plugin""" - __authors__ = [("stickell", "l.stickell@yahoo.it")] + __license__ = "GPLv3" + __authors__ = [("stickell", "l.stickell@yahoo.it")] - FILE_INFO_PATTERN = r"<h1 class='file_name'>(?P<N>\S+)</h1>\s*<span class='file_size'>Filesize: (?P<S>[\d.]+)(?P<U>\w+)</span>" + INFO_PATTERN = r'<h1 class=\'file_name\'>(?P<N>\S+)</h1>\s*<span class=\'file_size\'>Filesize: (?P<S>[\d.,]+)(?P<U>[\w^_]+)</span>' OFFLINE_PATTERN = r'There is no such file available' @@ -28,15 +29,16 @@ class LuckyShareNet(SimpleHoster): html = self.load(self.pyfile.url, decode=True) m = re.search(r"waitingtime = (\d+);", html) if m: - waittime = int(m.group(1)) - self.logDebug("You have to wait %d seconds between free downloads" % waittime) - self.retry(wait_time=waittime) + seconds = int(m.group(1)) + self.logDebug("You have to wait %d seconds between free downloads" % seconds) + self.retry(wait_time=seconds) else: - self.parseError('Unable to detect wait time between free downloads') + self.error(_("Unable to detect wait time between free downloads")) elif 'Hash expired' in rep: - self.retry(reason="Hash expired") + self.retry(reason=_("Hash expired")) return json_loads(rep) + # TODO: There should be a filesize limit for free downloads # TODO: Some files could not be downloaded in free mode def handleFree(self): @@ -50,12 +52,8 @@ class LuckyShareNet(SimpleHoster): recaptcha = ReCaptcha(self) - captcha_key = recaptcha.detect_key() - if captcha_key is None: - self.parseError("ReCaptcha key not found") - - for _ in xrange(5): - challenge, response = recaptcha.challenge(captcha_key) + for _i in xrange(5): + challenge, response = recaptcha.challenge() rep = self.load(r"http://luckyshare.net/download/verify/challenge/%s/response/%s/hash/%s" % (challenge, response, json['hash']), decode=True) self.logDebug("JSON: " + rep) @@ -64,13 +62,12 @@ class LuckyShareNet(SimpleHoster): self.correctCaptcha() break elif 'Verification failed' in rep: - self.logInfo("Wrong captcha") self.invalidCaptcha() else: - self.parseError('Unable to get downlaod link') + self.error(_("Unable to get downlaod link")) if not json['link']: - self.fail("No Download url retrieved/all captcha attempts failed") + self.fail(_("No Download url retrieved/all captcha attempts failed")) self.logDebug("Direct URL: " + json['link']) self.download(json['link']) |