diff options
Diffstat (limited to 'module/plugins/hoster/RapiduNet.py')
-rw-r--r-- | module/plugins/hoster/RapiduNet.py | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/module/plugins/hoster/RapiduNet.py b/module/plugins/hoster/RapiduNet.py index da353ec70..267f41f36 100644 --- a/module/plugins/hoster/RapiduNet.py +++ b/module/plugins/hoster/RapiduNet.py @@ -5,14 +5,15 @@ import re import time from module.common.json_layer import json_loads -from module.plugins.internal.ReCaptcha import ReCaptcha +from module.plugins.captcha.ReCaptcha import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class RapiduNet(SimpleHoster): __name__ = "RapiduNet" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" + __status__ = "testing" __pattern__ = r'https?://(?:www\.)?rapidu\.net/(?P<ID>\d{10})' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -33,23 +34,22 @@ class RapiduNet(SimpleHoster): def setup(self): - self.resumeDownload = True + self.resume_download = True self.multiDL = self.premium - def handleFree(self, pyfile): + def handle_free(self, pyfile): self.req.http.lastURL = pyfile.url self.req.http.c.setopt(pycurl.HTTPHEADER, ["X-Requested-With: XMLHttpRequest"]) - jsvars = self.getJsonResponse("https://rapidu.net/ajax.php", + jsvars = self.get_json_response("https://rapidu.net/ajax.php", get={'a': "getLoadTimeToDownload"}, - post={'_go': ""}, - decode=True) + post={'_go': ""}) - if str(jsvars['timeToDownload']) is "stop": + if str(jsvars['timeToDownload']) == "stop": t = (24 * 60 * 60) - (int(time.time()) % (24 * 60 * 60)) + time.altzone - self.logInfo("You've reach your daily download transfer") + self.log_info(_("You've reach your daily download transfer")) self.retry(10, 10 if t < 1 else None, _("Try tomorrow again")) #@NOTE: check t in case of not synchronised clock @@ -59,24 +59,23 @@ class RapiduNet(SimpleHoster): recaptcha = ReCaptcha(self) response, challenge = recaptcha.challenge(self.RECAPTCHA_KEY) - jsvars = self.getJsonResponse("https://rapidu.net/ajax.php", + jsvars = self.get_json_response("https://rapidu.net/ajax.php", get={'a': "getCheckCaptcha"}, post={'_go' : "", 'captcha1': challenge, 'captcha2': response, - 'fileId' : self.info['pattern']['ID']}, - decode=True) + 'fileId' : self.info['pattern']['ID']}) - if jsvars['message'] == 'success': + if jsvars['message'] == "success": self.link = jsvars['url'] - def getJsonResponse(self, *args, **kwargs): + def get_json_response(self, *args, **kwargs): res = self.load(*args, **kwargs) if not res.startswith('{'): self.retry() - self.logDebug(res) + self.log_debug(res) return json_loads(res) |