From acc46fc3497a66a427b795b4a22c6e71d69185a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 13 Dec 2014 15:56:57 +0100 Subject: Update --- pyload/plugin/hoster/RyushareCom.py | 81 +++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 pyload/plugin/hoster/RyushareCom.py (limited to 'pyload/plugin/hoster/RyushareCom.py') diff --git a/pyload/plugin/hoster/RyushareCom.py b/pyload/plugin/hoster/RyushareCom.py new file mode 100644 index 000000000..233ba57a4 --- /dev/null +++ b/pyload/plugin/hoster/RyushareCom.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +# +# Test links: +# http://ryushare.com/cl0jy8ric2js/random.bin + +import re + +from pyload.plugin.internal.XFSHoster import XFSHoster, create_getInfo +from pyload.plugin.internal.captcha import SolveMedia + + +class RyushareCom(XFSHoster): + __name = "RyushareCom" + __type = "hoster" + __version = "0.20" + + __pattern = r'http://(?:www\.)?ryushare\.com/\w+' + + __description = """Ryushare.com hoster plugin""" + __license = "GPLv3" + __authors = [("zoidberg", "zoidberg@mujmail.cz"), + ("stickell", "l.stickell@yahoo.it"), + ("quareevo", "quareevo@arcor.de")] + + + HOSTER_DOMAIN = "ryushare.com" + + SIZE_PATTERN = r'You have requested [^<]+ \((?P[\d.,]+) (?P[\w^_]+)' + + WAIT_PATTERN = r'You have to wait ((?P\d+) hour[s]?, )?((?P\d+) minute[s], )?(?P\d+) second[s]' + LINK_PATTERN = r'Click here to download<' + + + def getDownloadLink(self): + retry = False + self.html = self.load(self.pyfile.url) + action, inputs = self.parseHtmlForm(input_names={"op": re.compile("^download")}) + if "method_premium" in inputs: + del inputs['method_premium'] + + self.html = self.load(self.pyfile.url, post=inputs) + action, inputs = self.parseHtmlForm('F1') + + self.setWait(65) + # Wait 1 hour + if "You have reached the download-limit" in self.html: + self.setWait(1 * 60 * 60, True) + retry = True + + m = re.search(self.WAIT_PATTERN, self.html) + if m: + wait = m.groupdict(0) + waittime = int(wait['hour']) * 60 * 60 + int(wait['min']) * 60 + int(wait['sec']) + self.setWait(waittime, True) + retry = True + + self.wait() + if retry: + self.retry() + + for _i in xrange(5): + solvemedia = SolveMedia(self) + challenge, response = solvemedia.challenge() + + inputs['adcopy_challenge'] = challenge + inputs['adcopy_response'] = response + + self.html = self.load(self.pyfile.url, post=inputs) + if "WRONG CAPTCHA" in self.html: + self.invalidCaptcha() + else: + self.correctCaptcha() + break + else: + self.fail(_("You have entered 5 invalid captcha codes")) + + if "Click here to download" in self.html: + return re.search(r'Click here to download', self.html).group(1) + + +getInfo = create_getInfo(RyushareCom) -- cgit v1.2.3