diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-27 13:48:03 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-27 13:48:03 +0100 |
commit | b6a2bd53628bd2824bac1dafc7b4eafdf3c815dd (patch) | |
tree | 64df88ec33ffeb34d635e66785853a4a33b3cafc /module/plugins/internal | |
parent | [SimpleHoster] Improve _isDirectLink + move here secondsToMidnight routine + ... (diff) | |
download | pyload-b6a2bd53628bd2824bac1dafc7b4eafdf3c815dd.tar.xz |
Update plugins after SimpleHoster changes
Diffstat (limited to 'module/plugins/internal')
-rw-r--r-- | module/plugins/internal/SimpleCrypter.py | 15 | ||||
-rw-r--r-- | module/plugins/internal/XFSHoster.py | 17 |
2 files changed, 17 insertions, 15 deletions
diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index 6596828b3..428826456 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -12,7 +12,7 @@ from module.utils import fixup class SimpleCrypter(Crypter, SimpleHoster): __name__ = "SimpleCrypter" __type__ = "crypter" - __version__ = "0.34" + __version__ = "0.35" __pattern__ = r'^unmatchable$' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True), #: Overrides core.config['general']['folder_per_package'] @@ -28,16 +28,16 @@ class SimpleCrypter(Crypter, SimpleHoster): """ Following patterns should be defined by each crypter: - LINK_PATTERN: group(1) must be a download link or a regex to catch more links + LINK_PATTERN: Download link or regex to catch links in group(1) example: LINK_PATTERN = r'<div class="link"><a href="(.+?)"' - NAME_PATTERN: (optional) folder name or webpage title + NAME_PATTERN: (optional) folder name or page title example: NAME_PATTERN = r'<title>Files of: (?P<N>[^<]+) folder</title>' - OFFLINE_PATTERN: (optional) Checks if the file is yet available online + OFFLINE_PATTERN: (optional) Checks if the page is unreachable example: OFFLINE_PATTERN = r'File (deleted|not found)' - TEMP_OFFLINE_PATTERN: (optional) Checks if the file is temporarily offline + TEMP_OFFLINE_PATTERN: (optional) Checks if the page is temporarily unreachable example: TEMP_OFFLINE_PATTERN = r'Server maintainance' @@ -120,7 +120,10 @@ class SimpleCrypter(Crypter, SimpleHoster): self.packages = [(self.info['name'], self.links, self.info['folder'])] - def checkNameSize(self): + def checkNameSize(self, getinfo=True): + if getinfo: + self.updateInfo(self.getInfo(self.pyfile.url, self.html)) + name = self.info['name'] url = self.info['url'] diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index 7c6ae5725..f2168d0c7 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -7,16 +7,15 @@ from time import sleep from pycurl import FOLLOWLOCATION, LOW_SPEED_TIME -from module.plugins.hoster.UnrestrictLi import secondsToMidnight from module.plugins.internal.CaptchaService import ReCaptcha, SolveMedia -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, secondsToMidnight from module.utils import html_unescape class XFSHoster(SimpleHoster): __name__ = "XFSHoster" __type__ = "hoster" - __version__ = "0.32" + __version__ = "0.33" __pattern__ = r'^unmatchable$' @@ -30,10 +29,10 @@ class XFSHoster(SimpleHoster): HOSTER_DOMAIN = None HOSTER_NAME = None - TEXT_ENCODING = False - COOKIES = [(HOSTER_DOMAIN, "lang", "english")] - DIRECT_LINK = None - MULTI_HOSTER = True #@NOTE: Should be default to False for safe, but I'm lazy... + TEXT_ENCODING = False + COOKIES = [(HOSTER_DOMAIN, "lang", "english")] + DIRECT_LINK = None + 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^_]+)' @@ -226,10 +225,10 @@ class XFSHoster(SimpleHoster): elif 'limit' in self.errmsg: if 'days' in self.errmsg: - delay = secondsToMidnight(gmt=2) + delay = secondsToMidnight(gmt=2) retries = 3 else: - delay = 1 * 60 * 60 + delay = 1 * 60 * 60 retries = 24 self.wantReconnect = True |