From 89cdcdb027ef22ddb391ff5840e616d7df8495ac Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 29 Dec 2011 12:52:55 +0100 Subject: updatemanager fix --- module/plugins/hooks/UpdateManager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 920a88060..0dfb42ff2 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -30,7 +30,7 @@ from module.plugins.Hook import threaded, Expose, Hook class UpdateManager(Hook): __name__ = "UpdateManager" - __version__ = "0.1" + __version__ = "0.11" __description__ = """checks for updates""" __config__ = [("activated", "bool", "Activated", "True"), ("interval", "int", "Check interval in minutes", "360"), @@ -124,6 +124,7 @@ class UpdateManager(Hook): else: name = filename.replace(".py", "") + #TODO: obsolete if prefix.endswith("s"): type = prefix[:-1] else: @@ -160,7 +161,7 @@ class UpdateManager(Hook): f.close() self.updated = True - reloads.append((type, name)) + reloads.append((prefix, name)) self.reloaded = self.core.pluginManager.reloadPlugins(reloads) @@ -191,4 +192,4 @@ class UpdateManager(Hook): reloads.append(id) self.mtimes[id] = mtime - self.core.pluginManager.reloadPlugins(reloads) \ No newline at end of file + self.core.pluginManager.reloadPlugins(reloads) -- cgit v1.2.3 From 050f570fbedb2477bdbcc3a3aa21a26efcef6a30 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 29 Dec 2011 22:42:57 +0100 Subject: rehost fix --- module/plugins/hooks/RehostTo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/RehostTo.py b/module/plugins/hooks/RehostTo.py index 34bcbf4c7..b16987f5c 100644 --- a/module/plugins/hooks/RehostTo.py +++ b/module/plugins/hooks/RehostTo.py @@ -5,7 +5,7 @@ from module.plugins.internal.MultiHoster import MultiHoster class RehostTo(MultiHoster): __name__ = "RehostTo" - __version__ = "0.4" + __version__ = "0.41" __type__ = "hook" __config__ = [("activated", "bool", "Activated", "False")] @@ -24,7 +24,7 @@ class RehostTo(MultiHoster): def coreReady(self): - self.account = self.core.accountManager.loadClass("accounts", "RehostTo") + self.account = self.core.accountManager.getAccountPlugin("RehostTo") user = self.account.selectAccount()[0] -- cgit v1.2.3 From f4a3d381506442380ae2b60cfbbee693d14b5457 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 3 Jan 2012 21:55:13 +0100 Subject: UpdateManager fix --- module/plugins/hooks/UpdateManager.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 0dfb42ff2..ce75399c5 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -15,7 +15,6 @@ along with this program; if not, see . @author: RaNaN - @interface-version: 0.1 """ import sys @@ -30,7 +29,7 @@ from module.plugins.Hook import threaded, Expose, Hook class UpdateManager(Hook): __name__ = "UpdateManager" - __version__ = "0.11" + __version__ = "0.12" __description__ = """checks for updates""" __config__ = [("activated", "bool", "Activated", "True"), ("interval", "int", "Check interval in minutes", "360"), @@ -172,7 +171,7 @@ class UpdateManager(Hook): self.last_check = time() modules = filter( - lambda m: m and (m.__name__.startswith("module.plugins.") or m.__name__.startswith("userplugins.")), + lambda m: m and (m.__name__.startswith("module.plugins.") or m.__name__.startswith("userplugins.")) and m.__name__.count(".") >= 2, sys.modules.itervalues()) reloads = [] -- cgit v1.2.3 From 503cff86eb5e5b902291f5995838f1facd84319c Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Thu, 5 Jan 2012 01:12:23 +0100 Subject: merge in plugin updates --- module/plugins/hooks/EasybytezCom.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 module/plugins/hooks/EasybytezCom.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py new file mode 100644 index 000000000..4dd39cca6 --- /dev/null +++ b/module/plugins/hooks/EasybytezCom.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- + +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster +import re + +def getConfigSet(option): + s = set(option.lower().replace(',','|').split('|')) + s.discard(u'') + return s + +class EasybytezCom(MultiHoster): + __name__ = "EasybytezCom" + __version__ = "0.01" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", "False"), + ("includeHoster", "str", "Use only for downloads from (comma-separated hosters)", ""), + ("excludeHoster", "str", "Do not use for downloads from (comma-separated hosters)", "")] + __description__ = """EasyBytez.com hook plugin""" + __author_name__ = ("zoidberg") + __author_mail__ = ("zoidberg@mujmail.cz") + + def getHoster(self): + + hoster = set(['2shared.com', 'easy-share.com', 'filefactory.com', 'fileserve.com', 'filesonic.com', 'hotfile.com', 'mediafire.com', 'megaupload.com', 'netload.in', 'rapidshare.com', 'uploading.com', 'wupload.com', 'oron.com', 'uploadstation.com', 'ul.to', 'uploaded.to']) + + option = self.getConfig('includeHoster').strip() + if option: hoster &= getConfigSet(option) + option = self.getConfig('excludeHoster').strip() + if option: hoster -= getConfigSet(option) + + return list(hoster) \ No newline at end of file -- cgit v1.2.3 From 6c653c5eb10a4b77f2e63ad1e745ba612a46ae03 Mon Sep 17 00:00:00 2001 From: zoidberg10 Date: Sun, 8 Jan 2012 10:48:53 +0100 Subject: add premium4.me --- module/plugins/hooks/Premium4Me.py | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 module/plugins/hooks/Premium4Me.py (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/Premium4Me.py b/module/plugins/hooks/Premium4Me.py new file mode 100644 index 000000000..fc3ce2343 --- /dev/null +++ b/module/plugins/hooks/Premium4Me.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- + +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster + +class Premium4Me(MultiHoster): + __name__ = "Premium4Me" + __version__ = "0.02" + __type__ = "hook" + + __config__ = [("activated", "bool", "Activated", "False"), + ("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), + ("hosterList", "str", "Hoster list (comma separated)", "")] + __description__ = """premium4.me hook plugin""" + __author_name__ = ("RaNaN", "zoidberg") + __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz") + + replacements = [("freakshare.net", "freakshare.com")] + + def getHoster(self): + + page = getURL("http://premium4.me/api/hosters.php?authcode=%s" % self.account.authcode) + hosters = set([x.strip() for x in page.replace("\"", "").split(";")]) + + configMode = self.getConfig('hosterListMode') + if configMode in ("listed", "unlisted"): + configList = set(self.getConfig('hosterList').strip().lower().replace(',','|').split('|')) + configList.discard(u'') + if configMode == "listed": + hosters &= configList + elif configMode == "unlisted": + hosters -= configList + + return list(hosters) + + def coreReady(self): + + self.account = self.core.accountManager.getAccountPlugin("Premium4Me") + + user = self.account.selectAccount()[0] + + if not user: + self.logError(_("Please add your premium4.me account first and restart pyLoad")) + return + + return MultiHoster.coreReady(self) \ No newline at end of file -- cgit v1.2.3 From 7dacdd1a89dc6a6d191495937d4193172cdfa14d Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 11 Jan 2012 18:42:23 +0100 Subject: Unrar fix --- module/plugins/hooks/ExtractArchive.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 82e9c1d36..b7960620d 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -25,7 +25,8 @@ if sys.version_info < (2, 7) and os.name != "nt": continue raise - def wait(self): + # unsued timeout option for older python version + def wait(self, timeout=0): """Wait for child process to terminate. Returns returncode attribute.""" if self.returncode is None: @@ -57,7 +58,7 @@ class ExtractArchive(Hook): Provides: unrarFinished (folder, filename) """ __name__ = "ExtractArchive" - __version__ = "0.1" + __version__ = "0.11" __description__ = "Extract different kind of archives" __config__ = [("activated", "bool", "Activated", True), ("fullpath", "bool", "Extract full path", True), @@ -66,7 +67,8 @@ class ExtractArchive(Hook): ("deletearchive", "bool", "Delete archives when done", False), ("subfolder", "bool", "Create subfolder for each package", False), ("destination", "folder", "Extract files to", ""), - ("queue", "bool", "Wait for all downloads to be fninished", True), + ("recursive", "bool", "Extract archives in archvies", True), + ("queue", "bool", "Wait for all downloads to be finished", True), ("renice", "int", "CPU Priority", 0), ] __author_name__ = ("pyload Team") __author_mail__ = ("adminpyload.org") @@ -185,7 +187,7 @@ class ExtractArchive(Hook): if not exists(file): self.logDebug("new file %s does not exists" % file) continue - if isfile(file): + if self.getConfig("recursive") and isfile(file): new_files_ids.append((file, fid)) #append as new target files_ids = new_files_ids # also check extracted files @@ -304,4 +306,4 @@ class ExtractArchive(Hook): gid = getgrnam(self.config["permission"]["group"])[2] chown(f, uid, gid) except Exception, e: - self.log.warning(_("Setting User and Group failed"), e) \ No newline at end of file + self.log.warning(_("Setting User and Group failed"), e) -- cgit v1.2.3 From 904f24ba78d6fd4a24dd78f667f4e7e92a5bac6d Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 14 Jan 2012 22:02:58 +0100 Subject: additional extract logs --- module/plugins/hooks/ExtractArchive.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index b7960620d..c789495ca 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -58,7 +58,7 @@ class ExtractArchive(Hook): Provides: unrarFinished (folder, filename) """ __name__ = "ExtractArchive" - __version__ = "0.11" + __version__ = "0.12" __description__ = "Extract different kind of archives" __config__ = [("activated", "bool", "Activated", True), ("fullpath", "bool", "Extract full path", True), @@ -160,6 +160,7 @@ class ExtractArchive(Hook): makedirs(out) files_ids = [(save_join(dl, p.folder, x["name"]), x["id"]) for x in p.getChildren().itervalues()] + matched = False # check as long there are unseen files while files_ids: @@ -167,7 +168,9 @@ class ExtractArchive(Hook): for plugin in self.plugins: targets = plugin.getTargets(files_ids) - if targets: self.logDebug("Targets for %s: %s" % (plugin.__name__, targets)) + if targets: + self.logDebug("Targets for %s: %s" % (plugin.__name__, targets)) + matched = True for target, fid in targets: if target in extracted: self.logDebug(basename(target), "skipped") @@ -192,6 +195,9 @@ class ExtractArchive(Hook): files_ids = new_files_ids # also check extracted files + if not matched: self.logInfo(_("No files found to extract")) + + def startExtracting(self, plugin, fid, passwords, thread): pyfile = self.core.files.getFile(fid) -- cgit v1.2.3