From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/hoster/RyushareCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/RyushareCom.py') diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index 4d3e9b7f3..ecfe389e3 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -23,7 +23,7 @@ class RyushareCom(XFileSharingPro): FILE_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]' - DIRECT_LINK_PATTERN = r'(http://([^/]*?ryushare.com|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\w+/\w+/)[^"\'<]+)' + LINK_PATTERN = r'(http://([^/]*?ryushare.com|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\w+/\w+/)[^"\'<]+)' SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' def getDownloadLink(self): -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hoster/RyushareCom.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/RyushareCom.py') diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index ecfe389e3..a26827401 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -31,7 +31,7 @@ class RyushareCom(XFileSharingPro): 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"] + del inputs['method_premium'] self.html = self.load(self.pyfile.url, post=inputs) action, inputs = self.parseHtmlForm('F1') @@ -45,7 +45,7 @@ class RyushareCom(XFileSharingPro): match = re.search(self.WAIT_PATTERN, self.html) if match: m = match.groupdict(0) - waittime = int(m["hour"]) * 60 * 60 + int(m["min"]) * 60 + int(m["sec"]) + waittime = int(m['hour']) * 60 * 60 + int(m['min']) * 60 + int(m['sec']) self.setWait(waittime, True) retry = True @@ -62,8 +62,8 @@ class RyushareCom(XFileSharingPro): captcha = SolveMedia(self) challenge, response = captcha.challenge(captchaKey) - inputs["adcopy_challenge"] = challenge - inputs["adcopy_response"] = response + inputs['adcopy_challenge'] = challenge + inputs['adcopy_response'] = response self.html = self.load(self.pyfile.url, post=inputs) if "WRONG CAPTCHA" in self.html: -- cgit v1.2.3 From 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:25:14 +0200 Subject: Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 --- module/plugins/hoster/RyushareCom.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'module/plugins/hoster/RyushareCom.py') diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index a26827401..31dd489b8 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -42,10 +42,10 @@ class RyushareCom(XFileSharingPro): self.setWait(1 * 60 * 60, True) retry = True - match = re.search(self.WAIT_PATTERN, self.html) - if match: - m = match.groupdict(0) - waittime = int(m['hour']) * 60 * 60 + int(m['min']) * 60 + int(m['sec']) + found = re.search(self.WAIT_PATTERN, self.html) + if found: + wait = found.groupdict(0) + waittime = int(wait['hour']) * 60 * 60 + int(wait['min']) * 60 + int(wait['sec']) self.setWait(waittime, True) retry = True @@ -54,11 +54,11 @@ class RyushareCom(XFileSharingPro): self.retry() for _ in xrange(5): - m = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if not m: + found = re.search(self.SOLVEMEDIA_PATTERN, self.html) + if found is None: self.parseError("Error parsing captcha") - captchaKey = m.group(1) + captchaKey = found.group(1) captcha = SolveMedia(self) challenge, response = captcha.challenge(captchaKey) @@ -76,8 +76,7 @@ class RyushareCom(XFileSharingPro): self.fail("You have entered 5 invalid captcha codes") if "Click here to download" in self.html: - m = re.search(r'Click here to download', self.html) - return m.group(1) + return re.search(r'Click here to download', self.html).group(1) getInfo = create_getInfo(RyushareCom) -- cgit v1.2.3 From 9395182da7afed55a29bde1c7cbefe4204e783f0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:02:09 +0200 Subject: Store all re.search/match object as "m" instead "found" --- module/plugins/hoster/RyushareCom.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/RyushareCom.py') diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index 31dd489b8..bc81f03c0 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -42,9 +42,9 @@ class RyushareCom(XFileSharingPro): self.setWait(1 * 60 * 60, True) retry = True - found = re.search(self.WAIT_PATTERN, self.html) - if found: - wait = found.groupdict(0) + 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 @@ -54,11 +54,11 @@ class RyushareCom(XFileSharingPro): self.retry() for _ in xrange(5): - found = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if found is None: + m = re.search(self.SOLVEMEDIA_PATTERN, self.html) + if m is None: self.parseError("Error parsing captcha") - captchaKey = found.group(1) + captchaKey = m.group(1) captcha = SolveMedia(self) challenge, response = captcha.challenge(captchaKey) -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hoster/RyushareCom.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/RyushareCom.py') diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index bc81f03c0..f9aaa83fe 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- - -# Test links (random.bin): +# +# Test links: # http://ryushare.com/cl0jy8ric2js/random.bin import re @@ -12,8 +12,10 @@ from module.plugins.internal.CaptchaService import SolveMedia class RyushareCom(XFileSharingPro): __name__ = "RyushareCom" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?ryushare\.com/\w+' __version__ = "0.15" + + __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") @@ -26,6 +28,7 @@ class RyushareCom(XFileSharingPro): LINK_PATTERN = r'(http://([^/]*?ryushare.com|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\w+/\w+/)[^"\'<]+)' SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' + def getDownloadLink(self): retry = False self.html = self.load(self.pyfile.url) -- cgit v1.2.3 From bb2d9e1a0a89cf0d137e947d35429598c859adb1 Mon Sep 17 00:00:00 2001 From: Lars Fricke Date: Sat, 30 Aug 2014 00:59:59 +0200 Subject: [RyushareCom] Fixed premium dl --- module/plugins/hoster/RyushareCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/RyushareCom.py') diff --git a/module/plugins/hoster/RyushareCom.py b/module/plugins/hoster/RyushareCom.py index f9aaa83fe..a24090cde 100644 --- a/module/plugins/hoster/RyushareCom.py +++ b/module/plugins/hoster/RyushareCom.py @@ -12,7 +12,7 @@ from module.plugins.internal.CaptchaService import SolveMedia class RyushareCom(XFileSharingPro): __name__ = "RyushareCom" __type__ = "hoster" - __version__ = "0.15" + __version__ = "0.16" __pattern__ = r'http://(?:www\.)?ryushare\.com/\w+' @@ -25,7 +25,7 @@ class RyushareCom(XFileSharingPro): FILE_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'(http://([^/]*?ryushare.com|\d+\.\d+\.\d+\.\d+)(:\d+/d/|/files/\w+/\w+/)[^"\'<]+)' + LINK_PATTERN = r'Click here to download<' SOLVEMEDIA_PATTERN = r'http:\/\/api\.solvemedia\.com\/papi\/challenge\.script\?k=(.*?)"' -- cgit v1.2.3