diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-06-02 01:10:08 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-06-02 01:10:08 +0200 |
commit | 6637b832d74e0cf1fb96a1731daeb5832ea31822 (patch) | |
tree | 0fd0868ab7c8f99256974d4f6f8db52f88d40e18 /module | |
parent | Merge pull request #1447 from GammaC0de/patch-1 (diff) | |
download | pyload-6637b832d74e0cf1fb96a1731daeb5832ea31822.tar.xz |
[SimpleCrypter] Update
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/internal/Extractor.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/ReCaptcha.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/SimpleCrypter.py | 16 | ||||
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 14 | ||||
-rw-r--r-- | module/plugins/internal/UnZip.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/XFSCrypter.py | 2 | ||||
-rw-r--r-- | module/plugins/internal/XFSHoster.py | 4 |
7 files changed, 18 insertions, 24 deletions
diff --git a/module/plugins/internal/Extractor.py b/module/plugins/internal/Extractor.py index 159b65ffe..1a98060d9 100644 --- a/module/plugins/internal/Extractor.py +++ b/module/plugins/internal/Extractor.py @@ -29,8 +29,8 @@ class Extractor: EXTENSIONS = [] - VERSION = "" REPAIR = False + VERSION = "" @classmethod diff --git a/module/plugins/internal/ReCaptcha.py b/module/plugins/internal/ReCaptcha.py index dea714a62..a9d0f3752 100644 --- a/module/plugins/internal/ReCaptcha.py +++ b/module/plugins/internal/ReCaptcha.py @@ -22,8 +22,8 @@ class ReCaptcha(Captcha): ("zapp-brannigan", "fuerst.reinje@web.de")] - KEY_V2_PATTERN = r'(?:data-sitekey=["\']|["\']sitekey["\']:\s*["\'])([\w-]+)' KEY_V1_PATTERN = r'(?:recaptcha(?:/api|\.net)/(?:challenge|noscript)\?k=|Recaptcha\.create\s*\(\s*["\'])([\w-]+)' + KEY_V2_PATTERN = r'(?:data-sitekey=["\']|["\']sitekey["\']:\s*["\'])([\w-]+)' def detect_key(self, html=None): diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index 8a37839b5..81f977e57 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -11,7 +11,7 @@ from module.utils import fixup, html_unescape class SimpleCrypter(Crypter, SimpleHoster): __name__ = "SimpleCrypter" __type__ = "crypter" - __version__ = "0.48" + __version__ = "0.49" __pattern__ = r'^unmatchable$' __config__ = [("use_subfolder" , "bool", "Save package to subfolder" , True), #: Overrides core.config['general']['folder_per_package'] @@ -55,15 +55,6 @@ class SimpleCrypter(Crypter, SimpleHoster): LINK_PATTERN = None - NAME_REPLACEMENTS = [("&#?\w+;", fixup)] - URL_REPLACEMENTS = [] - - TEXT_ENCODING = False #: Set to True or encoding name if encoding in http header is not correct - COOKIES = True #: or False or list of tuples [(domain, name, value)] - - LOGIN_ACCOUNT = False - LOGIN_PREMIUM = False - #@TODO: Remove in 0.4.10 def init(self): @@ -83,6 +74,7 @@ class SimpleCrypter(Crypter, SimpleHoster): self.info = {} self.html = "" + self.link = "" #@TODO: Move to hoster class in 0.4.10 self.links = [] #@TODO: Move to hoster class in 0.4.10 if self.LOGIN_PREMIUM and not self.premium: @@ -101,7 +93,7 @@ class SimpleCrypter(Crypter, SimpleHoster): def handleDirect(self, pyfile): while True: - header = self.load(self.link if hasattr(self, 'link') and self.link else pyfile.url, just_header=True, decode=True) + header = self.load(self.link or pyfile.url, just_header=True, decode=True) if 'location' in header and header['location']: self.link = header['location'] else: @@ -114,7 +106,7 @@ class SimpleCrypter(Crypter, SimpleHoster): self.logDebug("Looking for link redirect...") self.handleDirect(pyfile) - if hasattr(self, 'link') and self.link: + if self.link: self.urls = [self.link] else: diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 222ba4b05..52ec25a5a 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -239,7 +239,7 @@ def secondsToMidnight(gmt=0): class SimpleHoster(Hoster): __name__ = "SimpleHoster" __type__ = "hoster" - __version__ = "1.51" + __version__ = "1.52" __pattern__ = r'^unmatchable$' __config__ = [("use_premium", "bool", "Use premium account if available" , True), @@ -308,13 +308,14 @@ class SimpleHoster(Hoster): SIZE_REPLACEMENTS = [] URL_REPLACEMENTS = [] - TEXT_ENCODING = False #: Set to True or encoding name if encoding value in http header is not correct - COOKIES = True #: or False or list of tuples [(domain, name, value)] CHECK_TRAFFIC = False #: Set to True to force checking traffic left for premium account + COOKIES = True #: or False or list of tuples [(domain, name, value)] DIRECT_LINK = None #: Set to True to looking for direct link (as defined in handleDirect method), set to None to do it if self.account is True else False - MULTI_HOSTER = False #: Set to True to leech other hoster link (as defined in handleMulti method) - LOGIN_ACCOUNT = False #: Set to True to require account login DISPOSITION = True #: Set to True to use any content-disposition value in http header as file name + LOGIN_ACCOUNT = False #: Set to True to require account login + LOGIN_PREMIUM = False #: Set to True to require premium account login + MULTI_HOSTER = False #: Set to True to leech other hoster link (as defined in handleMulti method) + TEXT_ENCODING = False #: Set to True or encoding name if encoding value in http header is not correct directLink = getFileURL #@TODO: Remove in 0.4.10 @@ -430,6 +431,9 @@ class SimpleHoster(Hoster): if not self.getConfig('use_premium', True): self.retryFree() + if self.LOGIN_PREMIUM and not self.premium: + self.fail(_("Required premium account not found")) + if self.LOGIN_ACCOUNT and not self.account: self.fail(_("Required account not found")) diff --git a/module/plugins/internal/UnZip.py b/module/plugins/internal/UnZip.py index 8d3fec370..4c18a0e35 100644 --- a/module/plugins/internal/UnZip.py +++ b/module/plugins/internal/UnZip.py @@ -19,8 +19,8 @@ class UnZip(Extractor): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - EXTENSIONS = [".zip", ".zip64"] VERSION ="(python %s.%s.%s)" % (sys.version_info[0], sys.version_info[1], sys.version_info[2]) + EXTENSIONS = [".zip", ".zip64"] @classmethod diff --git a/module/plugins/internal/XFSCrypter.py b/module/plugins/internal/XFSCrypter.py index 80eff53ea..8b333b45c 100644 --- a/module/plugins/internal/XFSCrypter.py +++ b/module/plugins/internal/XFSCrypter.py @@ -19,8 +19,8 @@ class XFSCrypter(SimpleCrypter): URL_REPLACEMENTS = [(r'&?per_page=\d+', ""), (r'[?/&]+$', ""), (r'(.+/[^?]+)$', r'\1?'), (r'$', r'&per_page=10000')] - LINK_PATTERN = r'<(?:td|TD).*?>\s*(?:<.+>\s*)?<a href="(.+?)".*?>.+?(?:</a>)?\s*(?:<.+>\s*)?</(?:td|TD)>' NAME_PATTERN = r'<[Tt]itle>.*?\: (?P<N>.+) folder</[Tt]itle>' + LINK_PATTERN = r'<(?:td|TD).*?>\s*(?:<.+>\s*)?<a href="(.+?)".*?>.+?(?:</a>)?\s*(?:<.+>\s*)?</(?:td|TD)>' OFFLINE_PATTERN = r'>\s*\w+ (Not Found|file (was|has been) removed)' TEMP_OFFLINE_PATTERN = r'>\s*\w+ server (is in )?(maintenance|maintainance)' diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index b0a1ce4ee..e0fd8fa8d 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -27,9 +27,7 @@ class XFSHoster(SimpleHoster): HOSTER_DOMAIN = None - TEXT_ENCODING = False - DIRECT_LINK = None - MULTI_HOSTER = True #@NOTE: Should be default to False for safe, but I'm lazy... + MULTI_HOSTER = True #@NOTE: Should be default to False for safe, but I'm lazy... NAME_PATTERN = r'(Filename[ ]*:[ ]*</b>(</td><td nowrap>)?|name="fname"[ ]+value="|<[\w^_]+ class="(file)?name">)\s*(?P<N>.+?)(\s*<|")' SIZE_PATTERN = r'(Size[ ]*:[ ]*</b>(</td><td>)?|File:.*>|</font>\s*\(|<[\w^_]+ class="size">)\s*(?P<S>[\d.,]+)\s*(?P<U>[\w^_]+)' |