diff options
Diffstat (limited to 'module/plugins/internal')
-rw-r--r-- | module/plugins/internal/Container.py | 6 | ||||
-rw-r--r-- | module/plugins/internal/Crypter.py | 10 | ||||
-rw-r--r-- | module/plugins/internal/Hoster.py | 4 | ||||
-rw-r--r-- | module/plugins/internal/MultiHoster.py | 11 | ||||
-rw-r--r-- | module/plugins/internal/SimpleCrypter.py | 16 | ||||
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 12 | ||||
-rw-r--r-- | module/plugins/internal/XFSCrypter.py | 9 | ||||
-rw-r--r-- | module/plugins/internal/XFSHoster.py | 9 |
8 files changed, 40 insertions, 37 deletions
diff --git a/module/plugins/internal/Container.py b/module/plugins/internal/Container.py index 5d294725d..cff4ac4ec 100644 --- a/module/plugins/internal/Container.py +++ b/module/plugins/internal/Container.py @@ -16,7 +16,9 @@ class Container(Crypter): __status__ = "stable" __pattern__ = r'^unmatchable$' - __config__ = [("activated", "bool", "Activated", True)] + __config__ = [("activated" , "bool", "Activated" , True), + ("use_subfolder" , "bool", "Save package to subfolder" , True), + ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] __description__ = """Base container decrypter plugin""" __license__ = "GPLv3" @@ -34,7 +36,7 @@ class Container(Crypter): self.delete_tmp() - if self.urls: + if self.links: self._generate_packages() elif not self.packages: diff --git a/module/plugins/internal/Crypter.py b/module/plugins/internal/Crypter.py index 71076ad0a..157ce5dab 100644 --- a/module/plugins/internal/Crypter.py +++ b/module/plugins/internal/Crypter.py @@ -23,12 +23,12 @@ class Crypter(Base): def init_base(self): self.packages = [] #: Put all packages here. It's a list of tuples like: ( name, [list of links], folder ) - self.urls = [] #: List of urls, pyLoad will generate packagenames + self.links = [] #: List of urls, pyLoad will generate packagenames def setup_base(self): self.packages = [] - self.urls = [] + self.links = [] def process(self, pyfile): @@ -37,7 +37,7 @@ class Crypter(Base): """ self.decrypt(pyfile) - if self.urls: + if self.links: self._generate_packages() elif not self.packages: @@ -55,9 +55,9 @@ class Crypter(Base): def _generate_packages(self): """ - Generate new packages from self.urls + Generate new packages from self.links """ - packages = [(name, links, None) for name, links in self.pyload.api.generatePackages(self.urls).items()] + packages = [(name, links, None) for name, links in self.pyload.api.generatePackages(self.links).items()] self.packages.extend(packages) diff --git a/module/plugins/internal/Hoster.py b/module/plugins/internal/Hoster.py index 130622fa9..bbe37f39f 100644 --- a/module/plugins/internal/Hoster.py +++ b/module/plugins/internal/Hoster.py @@ -92,7 +92,7 @@ class Hoster(Base): try: self.process(self.pyfile) self.check_status() - self._check_download() + self.check_download() except Fail, e: #@TODO: Move to PluginThread in 0.4.10 if self.get_config('fallback', True) and self.premium: @@ -349,7 +349,7 @@ class Hoster(Base): self.last_download = "" #: Recheck in 0.4.10 - def _check_download(self): + def check_download(self): self.log_info(_("Checking downloaded file...")) if self.captcha.task and not self.last_download: diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py index 5cb3f6ed2..cbbfcd6dc 100644 --- a/module/plugins/internal/MultiHoster.py +++ b/module/plugins/internal/MultiHoster.py @@ -14,11 +14,12 @@ class MultiHoster(SimpleHoster): __status__ = "stable" __pattern__ = r'^unmatchable$' - __config__ = [("activated" , "bool", "Activated" , True), - ("use_premium" , "bool", "Use premium account if available" , True), - ("fallback" , "bool", "Fallback to free download if premium fails", True), - ("chk_filesize", "bool", "Check file size" , True), - ("revertfailed", "bool", "Revert to standard download if fails" , True)] + __config__ = [("activated" , "bool", "Activated" , True ), + ("use_premium" , "bool", "Use premium account if available" , True ), + ("fallback" , "bool", "Fallback to free download if premium fails" , False), + ("chk_filesize", "bool", "Check file size" , True ), + ("max_wait" , "int" , "Reconnect if waiting time is greater than minutes", 10 ), + ("revertfailed", "bool", "Revert to standard download if fails" , True )] __description__ = """Multi hoster plugin""" __license__ = "GPLv3" diff --git a/module/plugins/internal/SimpleCrypter.py b/module/plugins/internal/SimpleCrypter.py index 552edc405..f37323f90 100644 --- a/module/plugins/internal/SimpleCrypter.py +++ b/module/plugins/internal/SimpleCrypter.py @@ -163,7 +163,7 @@ class SimpleCrypter(Crypter): link = location elif link: - self.urls.append(link) + self.links.append(link) return else: self.log_warning(_("Too many redirects")) @@ -209,16 +209,16 @@ class SimpleCrypter(Crypter): self.log_info(_("Looking for direct link...")) self.handle_direct(pyfile) - if self.urls or self.packages: + if self.links or self.packages: self.log_info(_("Direct link detected")) else: self.log_info(_("Direct link not found")) - if not self.urls and not self.packages: + if not self.links and not self.packages: self.preload() self.check_errors() - self.urls.extend(self.get_links()) + self.links.extend(self.get_links()) if self.PAGES_PATTERN: self.handle_pages(pyfile) @@ -232,7 +232,7 @@ class SimpleCrypter(Crypter): if not links: self.error(_("Free decrypted link not found")) else: - self.urls.extend(links) + self.links.extend(links) def handle_premium(self, pyfile): @@ -244,7 +244,7 @@ class SimpleCrypter(Crypter): if not links: self.error(_("Premium decrypted link found")) else: - self.urls.extend(links) + self.links.extend(links) def get_links(self): @@ -260,7 +260,7 @@ class SimpleCrypter(Crypter): self.log_info(_("Decrypting as free link...")) self.handle_free(pyfile) - return self.urls + return self.links def load_page(self, number): @@ -276,7 +276,7 @@ class SimpleCrypter(Crypter): for p in xrange(2, pages + 1): self.data = self.load_page(p) - self.urls.extend(self.get_links()) + self.links.extend(self.get_links()) def check_errors(self): diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 56bd2d72f..e5ee65bdf 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -283,14 +283,10 @@ class SimpleHoster(Hoster): self.download(self.link, disposition=self.DISPOSITION) - def _check_download(self): - super(SimpleHoster, self)._check_download() - self.check_download() - - def check_download(self): - self.log_debug("Performing default check rules...") + super(SimpleHoster, self).check_download() + self.log_info(_("Checking downloaded file with built-in rules...") for r, p in self.FILE_ERRORS: errmsg = self.check_file({r: re.compile(p)}) if errmsg is not None: @@ -307,13 +303,15 @@ class SimpleHoster(Hoster): self.restart(errmsg) else: if self.CHECK_FILE: - self.log_debug("Performing custom check rules...") + self.log_info(_("Checking downloaded file with custom rules...") with open(encode(self.last_download), "rb") as f: self.data = f.read(1048576) #@TODO: Recheck in 0.4.10 self.check_errors() + self.log_info(_("File is OK")) + def check_errors(self): if not self.data: diff --git a/module/plugins/internal/XFSCrypter.py b/module/plugins/internal/XFSCrypter.py index 09511097b..7e0c14fe1 100644 --- a/module/plugins/internal/XFSCrypter.py +++ b/module/plugins/internal/XFSCrypter.py @@ -11,10 +11,11 @@ class XFSCrypter(SimpleCrypter): __status__ = "stable" __pattern__ = r'^unmatchable$' - __config__ = [("activated" , "bool", "Activated" , True), - ("use_premium" , "bool", "Use premium account if available" , True), - ("use_subfolder" , "bool", "Save package to subfolder" , True), - ("subfolder_per_package", "bool", "Create a subfolder for each package", True)] + __config__ = [("activated" , "bool", "Activated" , True), + ("use_premium" , "bool", "Use premium account if available" , True), + ("use_subfolder" , "bool", "Save package to subfolder" , True), + ("subfolder_per_package", "bool", "Create a subfolder for each package" , True), + ("max_wait" , "int" , "Reconnect if waiting time is greater than minutes", 10 )] __description__ = """XFileSharing decrypter plugin""" __license__ = "GPLv3" diff --git a/module/plugins/internal/XFSHoster.py b/module/plugins/internal/XFSHoster.py index 52b17966d..e8c2073bd 100644 --- a/module/plugins/internal/XFSHoster.py +++ b/module/plugins/internal/XFSHoster.py @@ -16,10 +16,11 @@ class XFSHoster(SimpleHoster): __status__ = "stable" __pattern__ = r'^unmatchable$' - __config__ = [("activated" , "bool", "Activated" , True), - ("use_premium" , "bool", "Use premium account if available" , True), - ("fallback" , "bool", "Fallback to free download if premium fails", True), - ("chk_filesize", "bool", "Check file size" , True)] + __config__ = [("activated" , "bool", "Activated" , True), + ("use_premium" , "bool", "Use premium account if available" , True), + ("fallback" , "bool", "Fallback to free download if premium fails" , True), + ("chk_filesize", "bool", "Check file size" , True), + ("max_wait" , "int" , "Reconnect if waiting time is greater than minutes", 10 )] __description__ = """XFileSharing hoster plugin""" __license__ = "GPLv3" |