From 93592862b520a862c01f80c019e5c4bc43746c19 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 5 Jul 2014 16:54:20 +0200 Subject: [SimpleHoster] Better inline docs + changed "FILE_OFFLINE_PATTERN" to "OFFLINE_PATTERN" --- module/plugins/hoster/UpstoreNet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UpstoreNet.py') diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py index 9d1c4b3dd..69d209471 100644 --- a/module/plugins/hoster/UpstoreNet.py +++ b/module/plugins/hoster/UpstoreNet.py @@ -14,7 +14,7 @@ class UpstoreNet(SimpleHoster): __author_name__ = ("igel") FILE_INFO_PATTERN = r'
.*?
\s*\n

(?P.*?)

\s*\n
\s*\n\s*(?P[\d.]+) (?P\w+)' - FILE_OFFLINE_PATTERN = r'File not found' + OFFLINE_PATTERN = r'File not found' WAIT_PATTERN = r"var sec = (\d+)" CHASH_PATTERN = r'' -- cgit v1.2.3 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/UpstoreNet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/UpstoreNet.py') diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py index 69d209471..50dc431a9 100644 --- a/module/plugins/hoster/UpstoreNet.py +++ b/module/plugins/hoster/UpstoreNet.py @@ -16,9 +16,9 @@ class UpstoreNet(SimpleHoster): FILE_INFO_PATTERN = r'
.*?
\s*\n

(?P.*?)

\s*\n
\s*\n\s*(?P[\d.]+) (?P\w+)' OFFLINE_PATTERN = r'File not found' - WAIT_PATTERN = r"var sec = (\d+)" + WAIT_PATTERN = r'var sec = (\d+)' CHASH_PATTERN = r'' - DIRECT_LINK_PATTERN = r'' + LINK_PATTERN = r'' def handleFree(self): # STAGE 1: get link to continue @@ -55,7 +55,7 @@ class UpstoreNet(SimpleHoster): self.html = self.load(self.pyfile.url, post=post_data, decode=True) # STAGE 3: get direct link - m = re.search(self.DIRECT_LINK_PATTERN, self.html, re.DOTALL) + m = re.search(self.LINK_PATTERN, self.html, re.DOTALL) if m: break -- cgit v1.2.3 From 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:25:41 +0200 Subject: Fix code indentation, some bad whitespaces and missing authors + use 'not' instead 'is None' + replace __pattern__'s r" with r' + other minor cosmetics --- module/plugins/hoster/UpstoreNet.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/UpstoreNet.py') diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py index 50dc431a9..adda573bc 100644 --- a/module/plugins/hoster/UpstoreNet.py +++ b/module/plugins/hoster/UpstoreNet.py @@ -8,10 +8,11 @@ from module.plugins.internal.CaptchaService import ReCaptcha class UpstoreNet(SimpleHoster): __name__ = "UpstoreNet" __type__ = "hoster" - __pattern__ = r"https?://(?:www\.)?upstore\.net/" + __pattern__ = r'https?://(?:www\.)?upstore\.net/' __version__ = "0.02" __description__ = """Upstore.Net File Download Hoster""" - __author_name__ = ("igel") + __author_name__ = "igel" + __author_mail__ = "igelkun@myopera.com" FILE_INFO_PATTERN = r'
.*?
\s*\n

(?P.*?)

\s*\n
\s*\n\s*(?P[\d.]+) (?P\w+)' OFFLINE_PATTERN = r'File not found' @@ -20,6 +21,7 @@ class UpstoreNet(SimpleHoster): CHASH_PATTERN = r'' LINK_PATTERN = r'' + def handleFree(self): # STAGE 1: get link to continue m = re.search(self.CHASH_PATTERN, 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/UpstoreNet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/UpstoreNet.py') diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py index adda573bc..99aa25b48 100644 --- a/module/plugins/hoster/UpstoreNet.py +++ b/module/plugins/hoster/UpstoreNet.py @@ -25,7 +25,7 @@ class UpstoreNet(SimpleHoster): def handleFree(self): # STAGE 1: get link to continue m = re.search(self.CHASH_PATTERN, self.html) - if not m: + if m is None: self.parseError("could not detect hash") chash = m.group(1) self.logDebug("read hash " + chash) @@ -42,7 +42,7 @@ class UpstoreNet(SimpleHoster): # try the captcha 5 times for i in xrange(5): m = re.search(self.WAIT_PATTERN, self.html) - if not m: + if m is None: self.parseError("could not find wait pattern") wait_time = m.group(1) @@ -61,7 +61,7 @@ class UpstoreNet(SimpleHoster): if m: break - if not m: + if m is None: self.parseError("could not detect direct link") direct = m.group(1) -- 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/UpstoreNet.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/UpstoreNet.py') diff --git a/module/plugins/hoster/UpstoreNet.py b/module/plugins/hoster/UpstoreNet.py index 99aa25b48..140024731 100644 --- a/module/plugins/hoster/UpstoreNet.py +++ b/module/plugins/hoster/UpstoreNet.py @@ -1,15 +1,18 @@ # -*- coding: utf-8 -*- + import re -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo from module.plugins.internal.CaptchaService import ReCaptcha +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class UpstoreNet(SimpleHoster): __name__ = "UpstoreNet" __type__ = "hoster" - __pattern__ = r'https?://(?:www\.)?upstore\.net/' __version__ = "0.02" + + __pattern__ = r'https?://(?:www\.)?upstore\.net/' + __description__ = """Upstore.Net File Download Hoster""" __author_name__ = "igel" __author_mail__ = "igelkun@myopera.com" -- cgit v1.2.3