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/LoadTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/LoadTo.py') diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index e52346274..5cad8b580 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -35,7 +35,7 @@ class LoadTo(SimpleHoster): FILE_INFO_PATTERN = r']+>(?P.+)\s*Size: (?P\d+) (?P[kKmMgG]?i?[bB])' URL_PATTERN = r'
Date: Wed, 9 Jul 2014 20:07:05 +0200 Subject: [LoadTo] Fixed 3 bugs --- module/plugins/hoster/LoadTo.py | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) (limited to 'module/plugins/hoster/LoadTo.py') diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index 5cad8b580..5daf1b8e3 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -20,25 +20,25 @@ import re +from module.plugins.internal.CaptchaService import SolveMedia from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -from module.plugins.internal.CaptchaService import ReCaptcha class LoadTo(SimpleHoster): __name__ = "LoadTo" __type__ = "hoster" __pattern__ = r'http://(?:www\.)?load\.to/\w+' - __version__ = "0.13" + __version__ = "0.14" __description__ = """Load.to hoster plugin""" __author_name__ = ("halfman", "stickell") __author_mail__ = ("Pulpan3@gmail.com", "l.stickell@yahoo.it") - FILE_INFO_PATTERN = r']+>(?P.+)\s*Size: (?P\d+) (?P[kKmMgG]?i?[bB])' + FILE_INFO_PATTERN = r'(?P<N>.+) \/\/ Load.to' + FILE_SIZE_PATTERN = r']+>(?P.+)\s*Size: (?P.*) (?P[kKmMgG]?i?[bB])' URL_PATTERN = r'404 Not Found")}) if check == "404": self.logWarning("The captcha you entered was incorrect. Please try again.") -- 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/LoadTo.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'module/plugins/hoster/LoadTo.py') diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index 5daf1b8e3..b5f0e4109 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -35,11 +35,13 @@ class LoadTo(SimpleHoster): FILE_INFO_PATTERN = r'(?P<N>.+) \/\/ Load.to' FILE_SIZE_PATTERN = r']+>(?P.+)\s*Size: (?P.*) (?P[kKmMgG]?i?[bB])' - URL_PATTERN = r'404 Not Found")}) if check == "404": self.logWarning("The captcha you entered was incorrect. Please try again.") -- cgit v1.2.3 From d211a0748a235562aa5be1b2f86679146669abb8 Mon Sep 17 00:00:00 2001 From: stickell Date: Fri, 11 Jul 2014 11:29:57 +0200 Subject: [LoadTo] renamed pattern --- module/plugins/hoster/LoadTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/LoadTo.py') diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index b5f0e4109..6cf633636 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -28,12 +28,12 @@ class LoadTo(SimpleHoster): __name__ = "LoadTo" __type__ = "hoster" __pattern__ = r'http://(?:www\.)?load\.to/\w+' - __version__ = "0.14" + __version__ = "0.15" __description__ = """Load.to hoster plugin""" __author_name__ = ("halfman", "stickell") __author_mail__ = ("Pulpan3@gmail.com", "l.stickell@yahoo.it") - FILE_INFO_PATTERN = r'(?P<N>.+) \/\/ Load.to' + FILE_NAME_PATTERN = r'(?P<N>.+) \/\/ Load.to' FILE_SIZE_PATTERN = r']+>(?P.+)\s*Size: (?P.*) (?P[kKmMgG]?i?[bB])' OFFLINE_PATTERN = r'Can\'t find file\. Please check URL' -- 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/LoadTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/LoadTo.py') diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index 6cf633636..780e42ac2 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -56,7 +56,7 @@ class LoadTo(SimpleHoster): # Search for Download URL m = re.search(self.LINK_PATTERN, self.html) - if not m: + if m is None: self.parseError("Unable to detect download URL") download_url = m.group(1) @@ -68,7 +68,7 @@ class LoadTo(SimpleHoster): # Load.to is using solvemedia captchas since ~july 2014: found = re.search(self.SOLVEMEDIA_PATTERN, self.html) - if not found: + if found is None: self.download(download_url) else: captcha_key = found.group(1) -- cgit v1.2.3 From a9f81c043c62abcb3ce38971237693736833fdbe Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 20 Jul 2014 03:28:23 +0200 Subject: Fix hosters SH_COOKIES syntax --- module/plugins/hoster/LoadTo.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'module/plugins/hoster/LoadTo.py') diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index 780e42ac2..14c071cc4 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -26,9 +26,11 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class LoadTo(SimpleHoster): __name__ = "LoadTo" + __version__ = "0.15" __type__ = "hoster" + __pattern__ = r'http://(?:www\.)?load\.to/\w+' - __version__ = "0.15" + __description__ = """Load.to hoster plugin""" __author_name__ = ("halfman", "stickell") __author_mail__ = ("Pulpan3@gmail.com", "l.stickell@yahoo.it") @@ -46,14 +48,7 @@ class LoadTo(SimpleHoster): self.multiDL = True self.chunkLimit = 1 - def process(self, pyfile): - self.html = self.load(pyfile.url, decode=True) - self.getFileInfo() - - # Check if File is online - if re.search(self.OFFLINE_PATTERN, self.html): - self.offline() - + def handleFree(self): # Search for Download URL m = re.search(self.LINK_PATTERN, self.html) if m is None: -- 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/LoadTo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/LoadTo.py') diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index 14c071cc4..af86cd026 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -62,11 +62,11 @@ class LoadTo(SimpleHoster): self.wait(m.group(1)) # Load.to is using solvemedia captchas since ~july 2014: - 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.download(download_url) else: - captcha_key = found.group(1) + captcha_key = m.group(1) solvemedia = SolveMedia(self) captcha_challenge, captcha_response = solvemedia.challenge(captcha_key) self.download(download_url, post={"adcopy_challenge": captcha_challenge, "adcopy_response": captcha_response}) -- 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/LoadTo.py | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'module/plugins/hoster/LoadTo.py') diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index af86cd026..a35712124 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -1,20 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # -############################################################################ - -# Test links (random.bin): +# +# Test links: # http://www.load.to/JWydcofUY6/random.bin # http://www.load.to/oeSmrfkXE/random100.bin @@ -26,8 +12,8 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class LoadTo(SimpleHoster): __name__ = "LoadTo" - __version__ = "0.15" __type__ = "hoster" + __version__ = "0.15" __pattern__ = r'http://(?:www\.)?load\.to/\w+' -- cgit v1.2.3 From fa2b46b967b2f77c30334c28c3b6b437c762bab6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 4 Sep 2014 22:30:52 +0200 Subject: [LoadTo] Fix patterns --- module/plugins/hoster/LoadTo.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'module/plugins/hoster/LoadTo.py') diff --git a/module/plugins/hoster/LoadTo.py b/module/plugins/hoster/LoadTo.py index a35712124..18398e905 100644 --- a/module/plugins/hoster/LoadTo.py +++ b/module/plugins/hoster/LoadTo.py @@ -13,27 +13,30 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class LoadTo(SimpleHoster): __name__ = "LoadTo" __type__ = "hoster" - __version__ = "0.15" + __version__ = "0.16" __pattern__ = r'http://(?:www\.)?load\.to/\w+' - __description__ = """Load.to hoster plugin""" + __description__ = """ Load.to hoster plugin """ __author_name__ = ("halfman", "stickell") __author_mail__ = ("Pulpan3@gmail.com", "l.stickell@yahoo.it") - FILE_NAME_PATTERN = r'(?P<N>.+) \/\/ Load.to' - FILE_SIZE_PATTERN = r']+>(?P.+)\s*Size: (?P.*) (?P[kKmMgG]?i?[bB])' - OFFLINE_PATTERN = r'Can\'t find file\. Please check URL' + FILE_NAME_PATTERN = r'

(?P.+)

' + FILE_SIZE_PATTERN = r'Size: (?P[\d.]+) (?P\w+)' + OFFLINE_PATTERN = r'>Can\'t find file' LINK_PATTERN = r'