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/UploadheroCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UploadheroCom.py') diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index 6ee3dbeba..11536028a 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -36,7 +36,7 @@ class UploadheroCom(SimpleHoster): SH_COOKIES = [("http://uploadhero.co", "lang", "en")] FILE_NAME_PATTERN = r'
(?P.*?)
' FILE_SIZE_PATTERN = r'Taille du fichier : (?P.*?)' - FILE_OFFLINE_PATTERN = r'

|

Le lien du fichier ci-dessus n\'existe plus.' + OFFLINE_PATTERN = r'

|

Le lien du fichier ci-dessus n\'existe plus.' DOWNLOAD_URL_PATTERN = r' 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/UploadheroCom.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/UploadheroCom.py') diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index 11536028a..39797a5f3 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -33,18 +33,19 @@ class UploadheroCom(SimpleHoster): __author_name__ = ("mcmyst", "zoidberg") __author_mail__ = ("mcmyst@hotmail.fr", "zoidberg@mujmail.cz") - SH_COOKIES = [("http://uploadhero.co", "lang", "en")] FILE_NAME_PATTERN = r'
(?P.*?)
' FILE_SIZE_PATTERN = r'Taille du fichier : (?P.*?)' OFFLINE_PATTERN = r'

|

Le lien du fichier ci-dessus n\'existe plus.' - DOWNLOAD_URL_PATTERN = r'(\d+).*\s*(\d+)' CAPTCHA_PATTERN = r'"(/captchadl\.php\?[a-z0-9]+)"' FREE_URL_PATTERN = r'var magicomfg = \'"/]+)"' + PREMIUM_URL_PATTERN = r' Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hoster/UploadheroCom.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'module/plugins/hoster/UploadheroCom.py') diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index 39797a5f3..b481f6b2f 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -13,8 +13,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . - - @author: zoidberg """ # Test link (random.bin): -- 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/UploadheroCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UploadheroCom.py') diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index b481f6b2f..c7850f81a 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -49,7 +49,7 @@ class UploadheroCom(SimpleHoster): self.checkErrors() found = re.search(self.CAPTCHA_PATTERN, self.html) - if not found: + if found is None: self.parseError("Captcha URL") captcha_url = "http://uploadhero.co" + 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/UploadheroCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/UploadheroCom.py') diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index c7850f81a..aefd30023 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -35,7 +35,7 @@ class UploadheroCom(SimpleHoster): FILE_SIZE_PATTERN = r'Taille du fichier : (?P.*?)' OFFLINE_PATTERN = r'

|

Le lien du fichier ci-dessus n\'existe plus.' - SH_COOKIES = [("http://uploadhero.co", "lang", "en")] + SH_COOKIES = [(".uploadhero.co", "lang", "en")] IP_BLOCKED_PATTERN = r'href="(/lightbox_block_download.php\?min=.*?)"' IP_WAIT_PATTERN = r'(\d+).*\s*(\d+)' -- 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/UploadheroCom.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'module/plugins/hoster/UploadheroCom.py') diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index aefd30023..05f8e1199 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -48,18 +48,18 @@ class UploadheroCom(SimpleHoster): def handleFree(self): self.checkErrors() - found = re.search(self.CAPTCHA_PATTERN, self.html) - if found is None: + m = re.search(self.CAPTCHA_PATTERN, self.html) + if m is None: self.parseError("Captcha URL") - captcha_url = "http://uploadhero.co" + found.group(1) + captcha_url = "http://uploadhero.co" + m.group(1) for _ in xrange(5): captcha = self.decryptCaptcha(captcha_url) self.html = self.load(self.pyfile.url, get={"code": captcha}) - found = re.search(self.FREE_URL_PATTERN, self.html) - if found: + m = re.search(self.FREE_URL_PATTERN, self.html) + if m: self.correctCaptcha() - download_url = found.group(1) or found.group(2) + download_url = m.group(1) or m.group(2) break else: self.invalidCaptcha() @@ -76,12 +76,12 @@ class UploadheroCom(SimpleHoster): self.download(link) def checkErrors(self): - found = re.search(self.IP_BLOCKED_PATTERN, self.html) - if found: - self.html = self.load("http://uploadhero.co%s" % found.group(1)) + m = re.search(self.IP_BLOCKED_PATTERN, self.html) + if m: + self.html = self.load("http://uploadhero.co%s" % m.group(1)) - found = re.search(self.IP_WAIT_PATTERN, self.html) - wait_time = (int(found.group(1)) * 60 + int(found.group(2))) if found else 5 * 60 + m = re.search(self.IP_WAIT_PATTERN, self.html) + wait_time = (int(m.group(1)) * 60 + int(m.group(2))) if m else 5 * 60 self.wait(wait_time, True) self.retry() -- 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/UploadheroCom.py | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'module/plugins/hoster/UploadheroCom.py') diff --git a/module/plugins/hoster/UploadheroCom.py b/module/plugins/hoster/UploadheroCom.py index 05f8e1199..e34701ed7 100644 --- a/module/plugins/hoster/UploadheroCom.py +++ b/module/plugins/hoster/UploadheroCom.py @@ -1,32 +1,20 @@ # -*- coding: utf-8 -*- - -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see . -""" - -# Test link (random.bin): +# +# Test links: # http://uploadhero.co/dl/wQBRAVSM import re + from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class UploadheroCom(SimpleHoster): __name__ = "UploadheroCom" __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?uploadhero\.com?/dl/\w+' __version__ = "0.15" + + __pattern__ = r'http://(?:www\.)?uploadhero\.com?/dl/\w+' + __description__ = """UploadHero.co plugin""" __author_name__ = ("mcmyst", "zoidberg") __author_mail__ = ("mcmyst@hotmail.fr", "zoidberg@mujmail.cz") -- cgit v1.2.3