diff options
Diffstat (limited to 'module/plugins/hoster/RyushareCom.py')
-rw-r--r-- | module/plugins/hoster/RyushareCom.py | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index a24090cde..d2e4489a6 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -5,28 +5,30 @@ import re -from module.plugins.hoster.XFileSharingPro import XFileSharingPro, create_getInfo +from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo from module.plugins.internal.CaptchaService import SolveMedia -class RyushareCom(XFileSharingPro): - __name__ = "RyushareCom" - __type__ = "hoster" - __version__ = "0.16" +class RyushareCom(XFSHoster): + __name__ = "RyushareCom" + __type__ = "hoster" + __version__ = "0.20" __pattern__ = r'http://(?:www\.)?ryushare\.com/\w+' __description__ = """Ryushare.com hoster plugin""" - __author_name__ = ("zoidberg", "stickell", "quareevo") - __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it", "quareevo@arcor.de") + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it"), + ("quareevo", "quareevo@arcor.de")] - HOSTER_NAME = "ryushare.com" - FILE_SIZE_PATTERN = r'You have requested <font color="red">[^<]+</font> \((?P<S>[\d\.]+) (?P<U>\w+)' + HOSTER_DOMAIN = "ryushare.com" + + SIZE_PATTERN = r'You have requested <font color="red">[^<]+</font> \((?P<S>[\d.,]+) (?P<U>[\w^_]+)' WAIT_PATTERN = r'You have to wait ((?P<hour>\d+) hour[s]?, )?((?P<min>\d+) minute[s], )?(?P<sec>\d+) second[s]' LINK_PATTERN = r'<a href="([^"]+)">Click here to download<' - SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' def getDownloadLink(self): @@ -56,14 +58,9 @@ class RyushareCom(XFileSharingPro): if retry: self.retry() - for _ in xrange(5): - m = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if m is None: - self.parseError("Error parsing captcha") - - captchaKey = m.group(1) - captcha = SolveMedia(self) - challenge, response = captcha.challenge(captchaKey) + for _i in xrange(5): + solvemedia = SolveMedia(self) + challenge, response = solvemedia.challenge() inputs['adcopy_challenge'] = challenge inputs['adcopy_response'] = response @@ -71,12 +68,11 @@ class RyushareCom(XFileSharingPro): self.html = self.load(self.pyfile.url, post=inputs) if "WRONG CAPTCHA" in self.html: self.invalidCaptcha() - self.logInfo("Invalid Captcha") else: self.correctCaptcha() break else: - self.fail("You have entered 5 invalid captcha codes") + self.fail(_("You have entered 5 invalid captcha codes")) if "Click here to download" in self.html: return re.search(r'<a href="([^"]+)">Click here to download</a>', self.html).group(1) |