diff options
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r-- | module/plugins/hooks/AntiVirus.py | 2 | ||||
-rw-r--r-- | module/plugins/hooks/Checksum.py | 12 | ||||
-rw-r--r-- | module/plugins/hooks/ExtractArchive.py | 8 | ||||
-rw-r--r-- | module/plugins/hooks/SkipRev.py | 37 | ||||
-rw-r--r-- | module/plugins/hooks/UnSkipOnFail.py | 26 | ||||
-rw-r--r-- | module/plugins/hooks/XFileSharing.py | 8 |
6 files changed, 47 insertions, 46 deletions
diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index 55b883684..1a0f3f8bd 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -17,7 +17,7 @@ class AntiVirus(Addon): __name__ = "AntiVirus" __type__ = "hook" __version__ = "0.16" - __status__ = "testing" + __status__ = "broken" #@TODO: add trash option (use Send2Trash lib) __config__ = [("activated" , "bool" , "Activated" , False ), diff --git a/module/plugins/hooks/Checksum.py b/module/plugins/hooks/Checksum.py index 28fdeafee..af6f2f406 100644 --- a/module/plugins/hooks/Checksum.py +++ b/module/plugins/hooks/Checksum.py @@ -39,7 +39,7 @@ class Checksum(Addon): __name__ = "Checksum" __type__ = "hook" __version__ = "0.24" - __status__ = "testing" + __status__ = "broken" __config__ = [("activated" , "bool" , "Activated" , False ), ("check_checksum", "bool" , "Check checksum? (If False only size will be verified)", True ), @@ -168,15 +168,15 @@ class Checksum(Addon): def package_finished(self, pypack): dl_folder = fsjoin(self.pyload.config.get("general", "download_folder"), pypack.folder, "") - for link in pypack.getChildren().values(): - file_type = os.path.splitext(link['name'])[1][1:].lower() + for fid, fdata in pypack.getChildren().items(): + file_type = os.path.splitext(fdata['name'])[1][1:].lower() if file_type not in self.formats: continue - hash_file = encode(fsjoin(dl_folder, link['name'])) + hash_file = encode(fsjoin(dl_folder, fdata['name'])) if not os.path.isfile(hash_file): - self.log_warning(_("File not found"), link['name']) + self.log_warning(_("File not found"), fdata['name']) continue with open(hash_file) as f: @@ -184,7 +184,7 @@ class Checksum(Addon): for m in re.finditer(self.regexps.get(file_type, self.regexps['default']), text): data = m.groupdict() - self.log_debug(link['name'], data) + self.log_debug(fdata['name'], data) local_file = encode(fsjoin(dl_folder, data['NAME'])) algorithm = self.methods.get(file_type, file_type) diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 96c8d7ed3..a60205f20 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -99,7 +99,7 @@ class ExtractArchive(Addon): __name__ = "ExtractArchive" __type__ = "hook" __version__ = "1.54" - __status__ = "testing" + __status__ = "broken" __config__ = [("activated" , "bool" , "Activated" , True ), ("fullpath" , "bool" , "Extract with full paths" , True ), @@ -142,7 +142,7 @@ class ExtractArchive(Addon): def activate(self): - for p in ("UnRar", "SevenZip", "UnZip"): + for p in ("UnRar", "SevenZip", "UnZip", "UnTar"): try: module = self.pyload.pluginManager.loadModule("internal", p) klass = getattr(module, p) @@ -277,8 +277,8 @@ class ExtractArchive(Addon): matched = False success = True - files_ids = dict((pylink['name'], ((fsjoin(dl_folder, pypack.folder, pylink['name'])), pylink['id'], out)) for pylink \ - in sorted(pypack.getChildren().values(), key=lambda k: k['name'])).values() #: Remove duplicates + files_ids = dict((fdata['name'], ((fsjoin(dl_folder, pypack.folder, fdata['name'])), fid, out)) for fid, fdata \ + in sorted(pypack.getChildren().values(), key=lambda k: k['name'])).items() #: Remove duplicates #: Check as long there are unseen files while files_ids: diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 9b47c2081..429737e94 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -25,17 +25,18 @@ class SkipRev(Addon): return pyfile.pluginclass.get_info(pyfile.url)['name'] - def create_pyFile(self, link): + def _create_pyFile(self, data): + pylink = self.pyload.api._convertPyFile(data) return PyFile(self.pyload.files, - link.fid, - link.url, - link.name, - link.size, - link.status, - link.error, - link.plugin, - link.packageID, - link.order) + pylink.fid, + pylink.url, + pylink.name, + pylink.size, + pylink.status, + pylink.error, + pylink.plugin, + pylink.packageID, + pylink.order) def download_preparing(self, pyfile): @@ -50,8 +51,8 @@ class SkipRev(Addon): status_list = (1, 4, 8, 9, 14) if revtokeep < 0 else (1, 3, 4, 8, 9, 14) pyname = re.compile(r'%s\.part\d+\.rev$' % name.rsplit('.', 2)[0].replace('.', '\.')) - queued = [True for link in pyfile.package().getChildren() \ - if link.status not in status_list and pyname.match(link.name)].count(True) + queued = [True for fid, fdata in pyfile.package().getChildren().items() \ + if fdata['status'] not in status_list and pyname.match(fdata['name'])].count(True) if not queued or queued < revtokeep: #: Keep one rev at least in auto mode return @@ -70,15 +71,15 @@ class SkipRev(Addon): pyname = re.compile(r'%s\.part\d+\.rev$' % pyfile.name.rsplit('.', 2)[0].replace('.', '\.')) - for link in pyfile.package().getChildren(): - if link.status is 4 and pyname.match(link.name): - pylink = self.create_pyFile(link) + for fid, fdata in pyfile.package().getChildren().items(): + if fdata['status'] is 4 and pyname.match(fdata['name']): + pyfile_new = self._create_pyFile(fdata) if revtokeep > -1 or pyfile.name.endswith(".rev"): - pylink.setStatus("queued") + pyfile_new.setStatus("queued") else: - pylink.setCustomStatus(_("unskipped"), "queued") + pyfile_new.setCustomStatus(_("unskipped"), "queued") self.pyload.files.save() - pylink.release() + pyfile_new.release() return diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py index d51030b01..db43bca2b 100644 --- a/module/plugins/hooks/UnSkipOnFail.py +++ b/module/plugins/hooks/UnSkipOnFail.py @@ -32,12 +32,12 @@ class UnSkipOnFail(Addon): #: It creates a temporary PyFile object using #: "link" data, changes its status, and tells #: The pyload.files-manager to save its data. - pylink = self.create_pyFile(link) + pyfile_new = self._create_pyFile(link) - pylink.setCustomStatus(_("unskipped"), "queued") + pyfile_new.setCustomStatus(_("unskipped"), "queued") self.pyload.files.save() - pylink.release() + pyfile_new.release() else: self.log_info(_("No duplicates found")) @@ -71,14 +71,14 @@ class UnSkipOnFail(Addon): return link - def create_pyFile(self, link): + def _create_pyFile(self, pylink): return PyFile(self.pyload.files, - link.fid, - link.url, - link.name, - link.size, - link.status, - link.error, - link.plugin, - link.packageID, - link.order) + pylink.fid, + pylink.url, + pylink.name, + pylink.size, + pylink.status, + pylink.error, + pylink.plugin, + pylink.packageID, + pylink.order) diff --git a/module/plugins/hooks/XFileSharing.py b/module/plugins/hooks/XFileSharing.py index 201cbab53..4af246da8 100644 --- a/module/plugins/hooks/XFileSharing.py +++ b/module/plugins/hooks/XFileSharing.py @@ -9,10 +9,10 @@ from module.plugins.internal.Addon import Addon class XFileSharing(Addon): __name__ = "XFileSharing" __type__ = "hook" - __version__ = "0.54" + __version__ = "0.55" __status__ = "testing" - __config__ = [("activated" , "bool", "Activated" , True ), + __config__ = [("activated" , "bool", "Activated" , False), ("use_hoster_list" , "bool", "Load listed hosters only" , False), ("use_crypter_list", "bool", "Load listed crypters only" , False), ("use_builtin_list", "bool", "Load built-in plugin list" , True ), @@ -107,7 +107,7 @@ class XFileSharing(Addon): else: pattern = self.regexp[type][0] - self.log_info(_("Handle any %s site on the web!") % type) + self.log_info(_("Auto-discover new %ss") % type) return pattern @@ -122,7 +122,7 @@ class XFileSharing(Addon): dict['pattern'] = pattern dict['re'] = re.compile(pattern) - self.log_debug("Loaded %s pattern: %s" % (type, pattern)) + self.log_debug("Pattern for %ss: %s" % (type, pattern)) def _unload(self, type, plugin): |