summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/LuckyShareNet.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/LuckyShareNet.py')
-rw-r--r--module/plugins/hoster/LuckyShareNet.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/module/plugins/hoster/LuckyShareNet.py b/module/plugins/hoster/LuckyShareNet.py
index f4932d93d..788c1aca8 100644
--- a/module/plugins/hoster/LuckyShareNet.py
+++ b/module/plugins/hoster/LuckyShareNet.py
@@ -2,16 +2,16 @@
import re
-from bottle import json_loads
-
-from module.plugins.internal.ReCaptcha import ReCaptcha
+from module.common.json_layer import json_loads
+from module.plugins.captcha.ReCaptcha import ReCaptcha
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class LuckyShareNet(SimpleHoster):
__name__ = "LuckyShareNet"
__type__ = "hoster"
- __version__ = "0.07"
+ __version__ = "0.08"
+ __status__ = "testing"
__pattern__ = r'https?://(?:www\.)?luckyshare\.net/(?P<ID>\d{10,})'
__config__ = [("use_premium", "bool", "Use premium account if available", True)]
@@ -25,13 +25,13 @@ class LuckyShareNet(SimpleHoster):
OFFLINE_PATTERN = r'There is no such file available'
- def parseJson(self, rep):
+ def parse_json(self, rep):
if 'AJAX Error' in rep:
- html = self.load(self.pyfile.url, decode=True)
+ html = self.load(self.pyfile.url)
m = re.search(r"waitingtime = (\d+);", html)
if m:
seconds = int(m.group(1))
- self.logDebug("You have to wait %d seconds between free downloads" % seconds)
+ self.log_debug("You have to wait %d seconds between free downloads" % seconds)
self.retry(wait_time=seconds)
else:
self.error(_("Unable to detect wait time between free downloads"))
@@ -40,14 +40,14 @@ class LuckyShareNet(SimpleHoster):
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, pyfile):
- rep = self.load(r"http://luckyshare.net/download/request/type/time/file/" + self.info['pattern']['ID'], decode=True)
+ #@TODO: There should be a filesize limit for free downloads
+ #: Some files could not be downloaded in free mode
+ def handle_free(self, pyfile):
+ rep = self.load(r"http://luckyshare.net/download/request/type/time/file/" + self.info['pattern']['ID'])
- self.logDebug("JSON: " + rep)
+ self.log_debug("JSON: " + rep)
- json = self.parseJson(rep)
+ json = self.parse_json(rep)
self.wait(json['time'])
recaptcha = ReCaptcha(self)
@@ -55,14 +55,14 @@ class LuckyShareNet(SimpleHoster):
for _i in xrange(5):
response, challenge = 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)
+ (challenge, response, json['hash']))
+ self.log_debug("JSON: " + rep)
if 'link' in rep:
- json.update(self.parseJson(rep))
- self.correctCaptcha()
+ json.update(self.parse_json(rep))
+ self.captcha.correct()
break
elif 'Verification failed' in rep:
- self.invalidCaptcha()
+ self.captcha.invalid()
else:
self.error(_("Unable to get downlaod link"))