From bd365a1fed377665b00c3d815b096b7fa7a26374 Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Wed, 22 Apr 2015 09:20:38 +0200 Subject: [FilecryptCc.py] Fix circle captcha Fix https://github.com/pyload/pyload/issues/1364 --- module/plugins/crypter/FilecryptCc.py | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index baea8886b..7679e9446 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # http://filecrypt.cc/Container/64E039F859.html - +import base64 import binascii import re @@ -14,7 +14,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha class FilecryptCc(Crypter): __name__ = "FilecryptCc" __type__ = "crypter" - __version__ = "0.11" + __version__ = "0.12" __pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/\w+' @@ -39,7 +39,7 @@ class FilecryptCc(Crypter): def decrypt(self, pyfile): - self.html = self.load(pyfile.url) + self.html = self.load(pyfile.url, cookies=True) if "content notfound" in self.html: #@NOTE: "content notfound" is NOT a typo self.offline() @@ -64,7 +64,7 @@ class FilecryptCc(Crypter): self.logInfo(_("Found %d mirrors") % len(mirror)) for i in mirror[1:]: - self.siteWithLinks = self.siteWithLinks + self.load(i).decode("utf-8", "replace") + self.siteWithLinks = self.siteWithLinks + self.load(i, cookies=True).decode("utf-8", "replace") def handlePasswordProtection(self): @@ -78,7 +78,7 @@ class FilecryptCc(Crypter): if not password: self.fail(_("Please enter the password in package section and try again")) - self.html = self.load(self.pyfile.url, post={"password": password}) + self.html = self.load(self.pyfile.url, post={"password": password}, cookies=True) def handleCaptcha(self): @@ -94,17 +94,17 @@ class FilecryptCc(Crypter): self.siteWithLinks = self.load(self.pyfile.url, post={'recaptcha_response_field': captcha_code}, + cookies=True, decode=True) elif m2: #: circle captcha self.logDebug("Captcha-URL: %s" % m2.group(1)) - captcha_code = self.decryptCaptcha(urljoin("http://filecrypt.cc", m2.group(1)), - forceUser=True, - imgtype="gif", + captcha_code = self.decryptCaptcha('https://www.filecrypt.cc/captcha/circle.php?c=abc', result_type='positional') - + self.siteWithLinks = self.load(self.pyfile.url, post={'button.x': captcha_code[0], 'button.y': captcha_code[1]}, + cookies=True, decode=True) else: @@ -140,9 +140,9 @@ class FilecryptCc(Crypter): weblinks = re.findall(self.WEBLINK_PATTERN, self.siteWithLinks) for link in weblinks: - res = self.load("http://filecrypt.cc/Link/%s.html" % link) + res = self.load("http://filecrypt.cc/Link/%s.html" % link, cookies=True) link2 = re.search('', res) - res2 = self.load(link2.group(1), just_header=True) + res2 = self.load(link2.group(1), just_header=True, cookies=True) self.links.append(res2['location']) except Exception, e: @@ -165,14 +165,17 @@ class FilecryptCc(Crypter): # Get key key = binascii.unhexlify(str(jk)) + # Decode crypted + crypted = base64.standard_b64decode(crypted) + # Decrypt Key = key IV = key obj = AES.new(Key, AES.MODE_CBC, IV) - text = obj.decrypt(crypted.decode('base64')) + text = obj.decrypt(crypted) # Extract links - text = text.replace("\x00", "").replace("\r", "") - links = filter(bool, text.split('\n')) + links = filter(lambda x: x != "", + text.replace("\x00", "").replace("\r", "").split("\n")) return links -- cgit v1.2.3 From efbbbfe6cdba907f678779c10fe6532bd1f0054e Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Wed, 22 Apr 2015 09:45:16 +0200 Subject: Update FilecryptCc.py --- module/plugins/crypter/FilecryptCc.py | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index 7679e9446..9dd4f665d 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # http://filecrypt.cc/Container/64E039F859.html -import base64 + import binascii import re @@ -39,7 +39,7 @@ class FilecryptCc(Crypter): def decrypt(self, pyfile): - self.html = self.load(pyfile.url, cookies=True) + self.html = self.load(pyfile.url) if "content notfound" in self.html: #@NOTE: "content notfound" is NOT a typo self.offline() @@ -64,7 +64,7 @@ class FilecryptCc(Crypter): self.logInfo(_("Found %d mirrors") % len(mirror)) for i in mirror[1:]: - self.siteWithLinks = self.siteWithLinks + self.load(i, cookies=True).decode("utf-8", "replace") + self.siteWithLinks = self.siteWithLinks + self.load(i).decode("utf-8", "replace") def handlePasswordProtection(self): @@ -78,7 +78,7 @@ class FilecryptCc(Crypter): if not password: self.fail(_("Please enter the password in package section and try again")) - self.html = self.load(self.pyfile.url, post={"password": password}, cookies=True) + self.html = self.load(self.pyfile.url, post={"password": password}) def handleCaptcha(self): @@ -94,17 +94,15 @@ class FilecryptCc(Crypter): self.siteWithLinks = self.load(self.pyfile.url, post={'recaptcha_response_field': captcha_code}, - cookies=True, decode=True) elif m2: #: circle captcha self.logDebug("Captcha-URL: %s" % m2.group(1)) captcha_code = self.decryptCaptcha('https://www.filecrypt.cc/captcha/circle.php?c=abc', result_type='positional') - + self.siteWithLinks = self.load(self.pyfile.url, post={'button.x': captcha_code[0], 'button.y': captcha_code[1]}, - cookies=True, decode=True) else: @@ -140,9 +138,9 @@ class FilecryptCc(Crypter): weblinks = re.findall(self.WEBLINK_PATTERN, self.siteWithLinks) for link in weblinks: - res = self.load("http://filecrypt.cc/Link/%s.html" % link, cookies=True) + res = self.load("http://filecrypt.cc/Link/%s.html" % link) link2 = re.search('', res) - res2 = self.load(link2.group(1), just_header=True, cookies=True) + res2 = self.load(link2.group(1), just_header=True) self.links.append(res2['location']) except Exception, e: @@ -165,17 +163,14 @@ class FilecryptCc(Crypter): # Get key key = binascii.unhexlify(str(jk)) - # Decode crypted - crypted = base64.standard_b64decode(crypted) - # Decrypt Key = key IV = key obj = AES.new(Key, AES.MODE_CBC, IV) - text = obj.decrypt(crypted) + text = obj.decrypt(crypted.decode('base64')) # Extract links - links = filter(lambda x: x != "", - text.replace("\x00", "").replace("\r", "").split("\n")) + text = text.replace("\x00", "").replace("\r", "") + links = filter(bool, text.split('\n')) return links -- cgit v1.2.3 From 6f4f6a983362a8ac6037a04dfdb5c7e97aea761c Mon Sep 17 00:00:00 2001 From: Gutz-Pilz Date: Wed, 22 Apr 2015 14:39:57 +0200 Subject: remove "www" in circlecaptcha to get it working --- module/plugins/crypter/FilecryptCc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index 9dd4f665d..ca4cf57cb 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -98,7 +98,7 @@ class FilecryptCc(Crypter): elif m2: #: circle captcha self.logDebug("Captcha-URL: %s" % m2.group(1)) - captcha_code = self.decryptCaptcha('https://www.filecrypt.cc/captcha/circle.php?c=abc', + captcha_code = self.decryptCaptcha('https://filecrypt.cc/captcha/circle.php?c=abc', result_type='positional') self.siteWithLinks = self.load(self.pyfile.url, -- cgit v1.2.3 From 3e9b1980a488ff9947554c6f72fbe18637f3567e Mon Sep 17 00:00:00 2001 From: zapp-brannigan Date: Wed, 22 Apr 2015 21:02:21 +0200 Subject: [FilecryptCc.py] Avoid hardcoded urls Fix https://github.com/pyload/pyload/issues/1364 again ;) --- module/plugins/crypter/FilecryptCc.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index ca4cf57cb..3c55ddd01 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -14,7 +14,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha class FilecryptCc(Crypter): __name__ = "FilecryptCc" __type__ = "crypter" - __version__ = "0.12" + __version__ = "0.13" __pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/\w+' @@ -31,7 +31,7 @@ class FilecryptCc(Crypter): CAPTCHA_PATTERN = r'' + MIRROR_PAGE_PATTERN = r'"[\w]*" href="(https?://(?:www\.)?filecrypt.cc/Container/\w+\.html\?mirror=\d+)">' def setup(self): @@ -40,6 +40,7 @@ class FilecryptCc(Crypter): def decrypt(self, pyfile): self.html = self.load(pyfile.url) + self.base_url = self.pyfile.url.split("Container")[0] if "content notfound" in self.html: #@NOTE: "content notfound" is NOT a typo self.offline() @@ -88,7 +89,7 @@ class FilecryptCc(Crypter): if m: #: normal captcha self.logDebug("Captcha-URL: %s" % m.group(1)) - captcha_code = self.decryptCaptcha(urljoin("http://filecrypt.cc", m.group(1)), + captcha_code = self.decryptCaptcha(urljoin(self.base_url, m.group(1)), forceUser=True, imgtype="gif") @@ -98,7 +99,7 @@ class FilecryptCc(Crypter): elif m2: #: circle captcha self.logDebug("Captcha-URL: %s" % m2.group(1)) - captcha_code = self.decryptCaptcha('https://filecrypt.cc/captcha/circle.php?c=abc', + captcha_code = self.decryptCaptcha('%s%s?c=abc' %(self.base_url,m2.group(1)), result_type='positional') self.siteWithLinks = self.load(self.pyfile.url, @@ -130,7 +131,7 @@ class FilecryptCc(Crypter): return for i in dlc: - self.links.append("http://filecrypt.cc/DLC/%s.dlc" % i) + self.links.append("%s/DLC/%s.dlc" % (self.base_url,i)) def handleWeblinks(self): @@ -138,7 +139,7 @@ class FilecryptCc(Crypter): weblinks = re.findall(self.WEBLINK_PATTERN, self.siteWithLinks) for link in weblinks: - res = self.load("http://filecrypt.cc/Link/%s.html" % link) + res = self.load("%s/Link/%s.html" % (self.base_url,link)) link2 = re.search('', res) res2 = self.load(link2.group(1), just_header=True) self.links.append(res2['location']) -- cgit v1.2.3 From 2e13b1e9efedfbd39bbc5a0cee8795f6c46f842b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Apr 2015 21:18:24 +0200 Subject: [FilecryptCc] Version up --- module/plugins/crypter/FilecryptCc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index ca4cf57cb..fdb65b657 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- -# http://filecrypt.cc/Container/64E039F859.html +# +# Test links: +# http://filecrypt.cc/Container/64E039F859.html import binascii import re @@ -14,7 +16,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha class FilecryptCc(Crypter): __name__ = "FilecryptCc" __type__ = "crypter" - __version__ = "0.12" + __version__ = "0.13" __pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/\w+' -- cgit v1.2.3 From bc7ea571a65f01d5eb2b30d6707418e4dad25258 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 22 Apr 2015 21:32:48 +0200 Subject: [FilecryptCc] Version up (2) --- module/plugins/crypter/FilecryptCc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py index 1bbe8f4fe..495efd706 100644 --- a/module/plugins/crypter/FilecryptCc.py +++ b/module/plugins/crypter/FilecryptCc.py @@ -16,7 +16,7 @@ from module.plugins.internal.CaptchaService import ReCaptcha class FilecryptCc(Crypter): __name__ = "FilecryptCc" __type__ = "crypter" - __version__ = "0.13" + __version__ = "0.14" __pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/\w+' @@ -101,7 +101,7 @@ class FilecryptCc(Crypter): elif m2: #: circle captcha self.logDebug("Captcha-URL: %s" % m2.group(1)) - captcha_code = self.decryptCaptcha('%s%s?c=abc' %(self.base_url,m2.group(1)), + captcha_code = self.decryptCaptcha('%s%s?c=abc' %(self.base_url, m2.group(1)), result_type='positional') self.siteWithLinks = self.load(self.pyfile.url, @@ -133,7 +133,7 @@ class FilecryptCc(Crypter): return for i in dlc: - self.links.append("%s/DLC/%s.dlc" % (self.base_url,i)) + self.links.append("%s/DLC/%s.dlc" % (self.base_url, i)) def handleWeblinks(self): @@ -141,7 +141,7 @@ class FilecryptCc(Crypter): weblinks = re.findall(self.WEBLINK_PATTERN, self.siteWithLinks) for link in weblinks: - res = self.load("%s/Link/%s.html" % (self.base_url,link)) + res = self.load("%s/Link/%s.html" % (self.base_url, link)) link2 = re.search('', res) res2 = self.load(link2.group(1), just_header=True) self.links.append(res2['location']) -- cgit v1.2.3 From 6cd0159921cf420f68ad1deb17d089e67d79d802 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Fri, 24 Apr 2015 05:36:13 +0300 Subject: Update UpleaCom.py --- module/plugins/hoster/UpleaCom.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py index 59c593c93..b79456ebe 100644 --- a/module/plugins/hoster/UpleaCom.py +++ b/module/plugins/hoster/UpleaCom.py @@ -10,23 +10,26 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class UpleaCom(XFSHoster): __name__ = "UpleaCom" __type__ = "hoster" - __version__ = "0.06" + __version__ = "0.07" __pattern__ = r'https?://(?:www\.)?uplea\.com/dl/\w{15}' __description__ = """Uplea.com hoster plugin""" __license__ = "GPLv3" - __authors__ = [("Redleon", None)] + __authors__ = [("Redleon", None), + ("GammaC0de", None)] NAME_PATTERN = r'class="agmd size18">(?P.+?)<' - SIZE_PATTERN = r'size14">(?P[\d.,]+) (?P[\w^_])' + SIZE_PATTERN = r'size14">(?P[\d.,]+) (?P[\w^_]+?)' + SIZE_REPLACEMENTS = [('Ko','KB'), ('Mo','MB'), ('Go','GB')] OFFLINE_PATTERN = r'>You followed an invalid or expired link' + PREMIUM_PATTERN = r'You need to have a Premium subscription to download this file' - LINK_PATTERN = r'"(http?://\w+\.uplea\.com/anonym/.*?)"' + LINK_PATTERN = r'"(https?://\w+\.uplea\.com/anonym/.*?)"' - WAIT_PATTERN = r'timeText:([\d.]+),' + WAIT_PATTERN = r'timeText: ?([\d.]+),' STEP_PATTERN = r'' @@ -45,9 +48,14 @@ class UpleaCom(XFSHoster): m = re.search(self.WAIT_PATTERN, self.html) if m: - self.wait(m.group(1), True) + self.logDebug(_("Waiting %s seconds") % m.group(1)) + self.wait(int(m.group(1)), True) self.retry() + m = re.search(self.PREMIUM_PATTERN, self.html) + if m: + self.error(_("This URL requires a premium account")) + m = re.search(self.LINK_PATTERN, self.html) if m is None: self.error(_("LINK_PATTERN not found")) -- cgit v1.2.3 From 76dea6e0faffbb7343b36c9230d7dee3a1db0f89 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Fri, 24 Apr 2015 05:41:28 +0300 Subject: Update UpleaCom.py --- module/plugins/hoster/UpleaCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py index b79456ebe..039d2f552 100644 --- a/module/plugins/hoster/UpleaCom.py +++ b/module/plugins/hoster/UpleaCom.py @@ -49,7 +49,7 @@ class UpleaCom(XFSHoster): m = re.search(self.WAIT_PATTERN, self.html) if m: self.logDebug(_("Waiting %s seconds") % m.group(1)) - self.wait(int(m.group(1)), True) + self.wait(m.group(1), True) self.retry() m = re.search(self.PREMIUM_PATTERN, self.html) -- cgit v1.2.3 From 1f5c090d4d7df29870b471a47dc7b29d809c62c9 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Sun, 26 Apr 2015 00:04:07 +0300 Subject: Update UpleaCom.py --- module/plugins/hoster/UpleaCom.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py index 039d2f552..65e0299ec 100644 --- a/module/plugins/hoster/UpleaCom.py +++ b/module/plugins/hoster/UpleaCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class UpleaCom(XFSHoster): __name__ = "UpleaCom" __type__ = "hoster" - __version__ = "0.07" + __version__ = "0.08" __pattern__ = r'https?://(?:www\.)?uplea\.com/dl/\w{15}' @@ -28,6 +28,7 @@ class UpleaCom(XFSHoster): PREMIUM_PATTERN = r'You need to have a Premium subscription to download this file' LINK_PATTERN = r'"(https?://\w+\.uplea\.com/anonym/.*?)"' + HOSTER_DOMAIN = "uplea.com" WAIT_PATTERN = r'timeText: ?([\d.]+),' STEP_PATTERN = r'' -- cgit v1.2.3 From b390a325d9c84f2eea0fd7307f18a18777523b13 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Mon, 27 Apr 2015 00:50:09 +0300 Subject: UpleaCom fix size calculation and Set DISPOSITION to False (temp) --- module/plugins/hoster/UpleaCom.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py index 65e0299ec..d9d1c8ef6 100644 --- a/module/plugins/hoster/UpleaCom.py +++ b/module/plugins/hoster/UpleaCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class UpleaCom(XFSHoster): __name__ = "UpleaCom" __type__ = "hoster" - __version__ = "0.08" + __version__ = "0.09" __pattern__ = r'https?://(?:www\.)?uplea\.com/dl/\w{15}' @@ -20,9 +20,11 @@ class UpleaCom(XFSHoster): ("GammaC0de", None)] + DISPOSITION = False #@TODO: Remove in 0.4.10 + NAME_PATTERN = r'class="agmd size18">(?P.+?)<' SIZE_PATTERN = r'size14">(?P[\d.,]+) (?P[\w^_]+?)' - SIZE_REPLACEMENTS = [('Ko','KB'), ('Mo','MB'), ('Go','GB')] + SIZE_REPLACEMENTS = [('ko','KB'), ('mo','MB'), ('go','GB'), ('Ko','KB'), ('Mo','MB'), ('Go','GB')] OFFLINE_PATTERN = r'>You followed an invalid or expired link' PREMIUM_PATTERN = r'You need to have a Premium subscription to download this file' -- cgit v1.2.3 From 6cb30f3923fa296ac7cb5aee9c2a935718df2529 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Wed, 29 Apr 2015 00:59:11 +0300 Subject: Update UpleaCom.py --- module/plugins/hoster/UpleaCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py index d9d1c8ef6..608282a60 100644 --- a/module/plugins/hoster/UpleaCom.py +++ b/module/plugins/hoster/UpleaCom.py @@ -10,7 +10,7 @@ from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class UpleaCom(XFSHoster): __name__ = "UpleaCom" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" __pattern__ = r'https?://(?:www\.)?uplea\.com/dl/\w{15}' @@ -22,8 +22,8 @@ class UpleaCom(XFSHoster): DISPOSITION = False #@TODO: Remove in 0.4.10 - NAME_PATTERN = r'class="agmd size18">(?P.+?)<' - SIZE_PATTERN = r'size14">(?P[\d.,]+) (?P[\w^_]+?)' + NAME_PATTERN = r'(?P.+?)' + SIZE_PATTERN = r'(?P[\d.,]+) (?P[\w^_]+?)' SIZE_REPLACEMENTS = [('ko','KB'), ('mo','MB'), ('go','GB'), ('Ko','KB'), ('Mo','MB'), ('Go','GB')] OFFLINE_PATTERN = r'>You followed an invalid or expired link' -- cgit v1.2.3 From 7c024578460b7db62de197541306ce30f5417f7e Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Wed, 29 Apr 2015 11:00:09 +0300 Subject: UploadedTo - Detect Maintenance Mode --- module/plugins/hoster/UploadedTo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 67f82d1f7..0bfed7d49 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -11,7 +11,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class UploadedTo(SimpleHoster): __name__ = "UploadedTo" __type__ = "hoster" - __version__ = "0.86" + __version__ = "0.87" __pattern__ = r'https?://(?:www\.)?(uploaded\.(to|net)|ul\.to)(/file/|/?\?id=|.*?&id=|/)(?P\w+)' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -27,6 +27,8 @@ class UploadedTo(SimpleHoster): URL_REPLACEMENTS = [(__pattern__ + ".*", r'http://uploaded.net/file/\g')] + TEMP_OFFLINE_PATTERN = r'uploaded.net - Maintenance - Wartungsarbeiten' + LINK_PREMIUM_PATTERN = r'
(\d+)' -- cgit v1.2.3 From 6f2fc4424a7cfa6e755004490488e5d92fb36389 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Wed, 29 Apr 2015 18:52:03 +0300 Subject: Update UploadedTo.py --- module/plugins/hoster/UploadedTo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 0bfed7d49..8a426d28d 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -27,7 +27,7 @@ class UploadedTo(SimpleHoster): URL_REPLACEMENTS = [(__pattern__ + ".*", r'http://uploaded.net/file/\g')] - TEMP_OFFLINE_PATTERN = r'uploaded.net - Maintenance - Wartungsarbeiten' + TEMP_OFFLINE_PATTERN = r'uploaded\.net - Maintenance - Wartungsarbeiten' LINK_PREMIUM_PATTERN = r'
Date: Wed, 29 Apr 2015 23:31:10 +0300 Subject: fix 'Content-Disposition' filename cutting first and last chars --- module/plugins/internal/SimpleHoster.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index d65d12403..f32d7c036 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -245,7 +245,7 @@ def secondsToMidnight(gmt=0): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "1.38" + __version__ = "1.39" __pattern__ = r'^unmatchable$' __config__ = [("use_premium", "bool", "Use premium account if available", True)] @@ -501,7 +501,7 @@ class SimpleHoster(Hoster): try: if disposition: content = urllib2.urlopen(url).info()['Content-Disposition'].split(';') - self.pyfile.name = (content[1].split('filename=')[1][1:-1] + self.pyfile.name = (content[1].split('filename=')[1].strip('"') or urlparse.urlparse(urllib.unquote(url)).path.split('/')[-1] or self.pyfile.name) finally: -- cgit v1.2.3 From 831e1cd10f97b890d980ba0b5708284bb23b0f64 Mon Sep 17 00:00:00 2001 From: GammaC0de Date: Wed, 29 Apr 2015 23:48:34 +0300 Subject: Update SimpleHoster.py --- module/plugins/internal/SimpleHoster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index f32d7c036..0bc529cbe 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -501,7 +501,7 @@ class SimpleHoster(Hoster): try: if disposition: content = urllib2.urlopen(url).info()['Content-Disposition'].split(';') - self.pyfile.name = (content[1].split('filename=')[1].strip('"') + self.pyfile.name = (content[1].split('filename=')[1].strip('"\'') or urlparse.urlparse(urllib.unquote(url)).path.split('/')[-1] or self.pyfile.name) finally: -- cgit v1.2.3 From cc5accb444abc29bd0e23e6a0f78cf5f5a993640 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 30 Apr 2015 19:20:11 +0200 Subject: Spare code cosmetics --- module/plugins/hoster/BasePlugin.py | 4 ++-- module/plugins/hoster/Ftp.py | 4 ++-- module/plugins/hoster/UpleaCom.py | 17 +++++++---------- module/plugins/hoster/UploadedTo.py | 2 +- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 418f446eb..28a916fe8 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -13,7 +13,7 @@ from module.plugins.Hoster import Hoster class BasePlugin(Hoster): __name__ = "BasePlugin" __type__ = "hoster" - __version__ = "0.41" + __version__ = "0.42" __pattern__ = r'^unmatchable$' @@ -46,7 +46,7 @@ class BasePlugin(Hoster): try: if disposition: content = urllib2.urlopen(url).info()['Content-Disposition'].split(';') - self.pyfile.name = content[1].split('filename=')[1][1:-1] or self.pyfile.name + self.pyfile.name = content[1].split('filename=')[1].strip('"\'') or self.pyfile.name finally: return super(BasePlugin, self).download(url, get, post, ref, cookies, False) diff --git a/module/plugins/hoster/Ftp.py b/module/plugins/hoster/Ftp.py index cfe230f42..546845ca0 100644 --- a/module/plugins/hoster/Ftp.py +++ b/module/plugins/hoster/Ftp.py @@ -12,7 +12,7 @@ from module.plugins.Hoster import Hoster class Ftp(Hoster): __name__ = "Ftp" __type__ = "hoster" - __version__ = "0.49" + __version__ = "0.50" __pattern__ = r'(?:ftps?|sftp)://([\w.-]+(:[\w.-]+)?@)?[\w.-]+(:\d+)?/.+' @@ -33,7 +33,7 @@ class Ftp(Hoster): try: if disposition: content = urllib2.urlopen(url).info()['Content-Disposition'].split(';') - self.pyfile.name = content[1].split('filename=')[1][1:-1] or self.pyfile.name + self.pyfile.name = content[1].split('filename=')[1].strip('"\'') or self.pyfile.name finally: return super(Ftp, self).download(url, get, post, ref, cookies, False) diff --git a/module/plugins/hoster/UpleaCom.py b/module/plugins/hoster/UpleaCom.py index 608282a60..4538b1c16 100644 --- a/module/plugins/hoster/UpleaCom.py +++ b/module/plugins/hoster/UpleaCom.py @@ -22,18 +22,19 @@ class UpleaCom(XFSHoster): DISPOSITION = False #@TODO: Remove in 0.4.10 - NAME_PATTERN = r'(?P.+?)' - SIZE_PATTERN = r'(?P[\d.,]+) (?P[\w^_]+?)' + HOSTER_DOMAIN = "uplea.com" + SIZE_REPLACEMENTS = [('ko','KB'), ('mo','MB'), ('go','GB'), ('Ko','KB'), ('Mo','MB'), ('Go','GB')] + NAME_PATTERN = r'(?P.+?)' + SIZE_PATTERN = r'(?P[\d.,]+) (?P[\w^_]+?)' OFFLINE_PATTERN = r'>You followed an invalid or expired link' - PREMIUM_PATTERN = r'You need to have a Premium subscription to download this file' LINK_PATTERN = r'"(https?://\w+\.uplea\.com/anonym/.*?)"' - HOSTER_DOMAIN = "uplea.com" - WAIT_PATTERN = r'timeText: ?([\d.]+),' - STEP_PATTERN = r'' + PREMIUM_ONLY_PATTERN = r'You need to have a Premium subscription to download this file' + WAIT_PATTERN = r'timeText: ?([\d.]+),' + STEP_PATTERN = r'' def setup(self): @@ -55,10 +56,6 @@ class UpleaCom(XFSHoster): self.wait(m.group(1), True) self.retry() - m = re.search(self.PREMIUM_PATTERN, self.html) - if m: - self.error(_("This URL requires a premium account")) - m = re.search(self.LINK_PATTERN, self.html) if m is None: self.error(_("LINK_PATTERN not found")) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 8a426d28d..75710ea8b 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -27,7 +27,7 @@ class UploadedTo(SimpleHoster): URL_REPLACEMENTS = [(__pattern__ + ".*", r'http://uploaded.net/file/\g')] - TEMP_OFFLINE_PATTERN = r'uploaded\.net - Maintenance - Wartungsarbeiten' + TEMP_OFFLINE_PATTERN = r'uploaded\.net - Maintenance' LINK_PREMIUM_PATTERN = r'<div class="tfree".*\s*<form method="post" action="(.+?)"' -- cgit v1.2.3