From 48c0c42fd6faffc56432d5f037cd575979f180cc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 02:23:37 +0200 Subject: Removed all @author flags + key attributes cleanup for internal & hooks plugins --- module/plugins/hooks/XFileSharingPro.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 19ecc08b6..09d035e10 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -9,14 +9,17 @@ class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __version__ = "0.11" __type__ = "hook" + __config__ = [("activated", "bool", "Activated", True), ("loadDefault", "bool", "Include default (built-in) hoster list", True), ("includeList", "str", "Include hosters (comma separated)", ""), ("excludeList", "str", "Exclude hosters (comma separated)", "")] + __description__ = """XFileSharingPro hook plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" + def coreReady(self): self.loadPattern() -- cgit v1.2.3 From 7b8c458cca7d21a029620f98e453f746fce69cd1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Jul 2014 16:10:01 +0200 Subject: Prefer single quote for dict key name --- module/plugins/hooks/XFileSharingPro.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 09d035e10..37a464b33 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -64,8 +64,8 @@ class XFileSharingPro(Hook): #self.logDebug(regexp) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] - dict["pattern"] = regexp - dict["re"] = re.compile(regexp) + dict['pattern'] = regexp + dict['re'] = re.compile(regexp) self.logDebug("Pattern loaded - handling %d hosters" % len(hosterList)) def getConfigSet(self, option): @@ -74,5 +74,5 @@ class XFileSharingPro(Hook): def unload(self): dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] - dict["pattern"] = r"^unmatchable$" - dict["re"] = re.compile(r"^unmatchable$") + dict['pattern'] = r'^unmatchable$' + dict['re'] = re.compile(r'^unmatchable$') -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/hooks/XFileSharingPro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 37a464b33..eb0376921 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -7,8 +7,8 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" - __version__ = "0.11" __type__ = "hook" + __version__ = "0.11" __config__ = [("activated", "bool", "Activated", True), ("loadDefault", "bool", "Include default (built-in) hoster list", True), -- cgit v1.2.3 From df2dcf1ccdbcc5197a224df9946595df907dc749 Mon Sep 17 00:00:00 2001 From: igel-kun Date: Mon, 15 Sep 2014 23:10:37 +0200 Subject: [XFilesharingPro] Embedded urls support --- module/plugins/hooks/XFileSharingPro.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index eb0376921..e19b40e22 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __config__ = [("activated", "bool", "Activated", True), ("loadDefault", "bool", "Include default (built-in) hoster list", True), @@ -23,6 +23,7 @@ class XFileSharingPro(Hook): def coreReady(self): self.loadPattern() + def loadPattern(self): hosterList = self.getConfigSet('includeList') excludeList = self.getConfigSet('excludeList') @@ -60,7 +61,7 @@ class XFileSharingPro(Hook): self.unload() return - regexp = r"http://(?:[^/]*\.)?(%s)/\w{12}" % ("|".join(sorted(hosterList)).replace('.', '\.')) + regexp = r"http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}" % ("|".join(sorted(hosterList)).replace('.', '\.')) #self.logDebug(regexp) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] @@ -68,10 +69,12 @@ class XFileSharingPro(Hook): dict['re'] = re.compile(regexp) self.logDebug("Pattern loaded - handling %d hosters" % len(hosterList)) + def getConfigSet(self, option): s = self.getConfig(option).lower().replace('|', ',').replace(';', ',') return set([x.strip() for x in s.split(',')]) + def unload(self): dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict['pattern'] = r'^unmatchable$' -- cgit v1.2.3 From 0d220d634e512d89bda540f91c643b361c82ea8a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Sep 2014 01:38:32 +0200 Subject: Logging string cosmetics --- module/plugins/hooks/XFileSharingPro.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index e19b40e22..1042d9498 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -62,7 +62,6 @@ class XFileSharingPro(Hook): return regexp = r"http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}" % ("|".join(sorted(hosterList)).replace('.', '\.')) - #self.logDebug(regexp) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict['pattern'] = regexp -- cgit v1.2.3 From 675dec650ee14137d9e613dcb780776257568654 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 13:11:04 +0200 Subject: [XFileSharingPro] Code cosmetics --- module/plugins/hooks/XFileSharingPro.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 1042d9498..65edbc72d 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -11,9 +11,9 @@ class XFileSharingPro(Hook): __version__ = "0.12" __config__ = [("activated", "bool", "Activated", True), - ("loadDefault", "bool", "Include default (built-in) hoster list", True), - ("includeList", "str", "Include hosters (comma separated)", ""), - ("excludeList", "str", "Exclude hosters (comma separated)", "")] + ("load_default", "bool", "Include default (built-in) hoster list", True), + ("include_hosters", "str", "Include hosters (comma separated)", ""), + ("exclude_hosters", "str", "Exclude hosters (comma separated)", "")] __description__ = """XFileSharingPro hook plugin""" __author_name__ = "zoidberg" @@ -25,11 +25,11 @@ class XFileSharingPro(Hook): def loadPattern(self): - hosterList = self.getConfigSet('includeList') - excludeList = self.getConfigSet('excludeList') + hoster_list = self.getConfigSet('include_hosters') + exclude_list = self.getConfigSet('exclude_hosters') - if self.getConfig('loadDefault'): - hosterList |= set(( + if self.getConfig('load_default'): + hoster_list |= set(( #WORKING HOSTERS: "aieshare.com", "asixfiles.com", "banashare.com", "cyberlocker.ch", "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "filedownloads.org", "hipfile.com", "kingsupload.com", "mlfat4arab.com", @@ -54,19 +54,19 @@ class XFileSharingPro(Hook): "ddlanime.com", "fileforth.com", "loombo.com", "goldfile.eu", "putshare.com" )) - hosterList -= (excludeList) - hosterList -= set(('', u'')) + hoster_list -= (exclude_list) + hoster_list -= set(('', u'')) - if not hosterList: + if not hoster_list: self.unload() return - regexp = r"http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}" % ("|".join(sorted(hosterList)).replace('.', '\.')) + regexp = r"http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}" % ("|".join(sorted(hoster_list)).replace('.', '\.')) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict['pattern'] = regexp dict['re'] = re.compile(regexp) - self.logDebug("Pattern loaded - handling %d hosters" % len(hosterList)) + self.logDebug("Pattern loaded - handling %d hosters" % len(hoster_list)) def getConfigSet(self, option): -- cgit v1.2.3 From b0868ae6446078bacf1635dde5e4ab316b4a94cb Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 7 Oct 2014 18:57:59 +0200 Subject: New __authors__ key replaces __author_name__ and __author_mail__ + Whitespaces and EOF fixup --- module/plugins/hooks/XFileSharingPro.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 65edbc72d..4b431f813 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -16,8 +16,7 @@ class XFileSharingPro(Hook): ("exclude_hosters", "str", "Exclude hosters (comma separated)", "")] __description__ = """XFileSharingPro hook plugin""" - __author_name__ = "zoidberg" - __author_mail__ = "zoidberg@mujmail.cz" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] def coreReady(self): -- cgit v1.2.3 From ae7a7e66981456e5bbe2b54006d79b6f907be7a4 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 8 Oct 2014 20:18:13 +0200 Subject: Add __license__ key attribute to plugins --- module/plugins/hooks/XFileSharingPro.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 4b431f813..46c693cf6 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -16,6 +16,7 @@ class XFileSharingPro(Hook): ("exclude_hosters", "str", "Exclude hosters (comma separated)", "")] __description__ = """XFileSharingPro hook plugin""" + __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] -- cgit v1.2.3 From 8939f015a688a07ec7d0bd14b6a3704f6a2cb4a0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 15:12:40 +0200 Subject: Pattern update 3 --- module/plugins/hooks/XFileSharingPro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 46c693cf6..741912457 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -61,7 +61,7 @@ class XFileSharingPro(Hook): self.unload() return - regexp = r"http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}" % ("|".join(sorted(hoster_list)).replace('.', '\.')) + regexp = r'http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}' % ('|'.join(sorted(hoster_list)).replace('.', '\.')) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict['pattern'] = regexp -- cgit v1.2.3 From 6cef0be257a01183aa6855d928f2ef7063174d89 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 11 Oct 2014 23:00:31 +0200 Subject: [XFileSharingPro] Hoster list cleanup + linestorage.com --- module/plugins/hooks/XFileSharingPro.py | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 741912457..44f2f544a 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __config__ = [("activated", "bool", "Activated", True), ("load_default", "bool", "Include default (built-in) hoster list", True), @@ -31,27 +31,14 @@ class XFileSharingPro(Hook): if self.getConfig('load_default'): hoster_list |= set(( #WORKING HOSTERS: - "aieshare.com", "asixfiles.com", "banashare.com", "cyberlocker.ch", "eyesfile.co", "eyesfile.com", - "fileband.com", "filedwon.com", "filedownloads.org", "hipfile.com", "kingsupload.com", "mlfat4arab.com", - "netuploaded.com", "odsiebie.pl", "q4share.com", "ravishare.com", "uptobox.com", "verzend.be", - "xvidstage.com", "thefile.me", "sharesix.com", "hostingbulk.com", + "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", + "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #NOT TESTED: - "bebasupload.com", "boosterking.com", "divxme.com", "filevelocity.com", "glumbouploads.com", - "grupload.com", "heftyfile.com", "host4desi.com", "laoupload.com", "linkzhost.com", "movreel.com", - "rockdizfile.com", "limfile.com", "share76.com", "sharebeast.com", "sharehut.com", "sharerun.com", - "shareswift.com", "sharingonline.com", "6ybh-upload.com", "skipfile.com", "spaadyshare.com", - "space4file.com", "uploadbaz.com", "uploadc.com", "uploaddot.com", "uploadfloor.com", "uploadic.com", - "uploadville.com", "vidbull.com", "zalaa.com", "zomgupload.com", "kupload.org", "movbay.org", - "multishare.org", "omegave.org", "toucansharing.org", "uflinq.org", "banicrazy.info", "flowhot.info", - "upbrasil.info", "shareyourfilez.biz", "bzlink.us", "cloudcache.cc", "fileserver.cc", "farshare.to", - "filemaze.ws", "filehost.ws", "filestock.ru", "moidisk.ru", "4up.im", "100shared.com", "sharesix.com", - "thefile.me", "filenuke.com", "sharerepo.com", "mightyupload.com", - #WRONG FILE NAME: - "sendmyway.com", "upchi.co.il", + "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", + "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", + "vidbull.com", "zalaa.com", "zomgupload.com", #NOT WORKING: - "amonshare.com", "imageporter.com", "file4safe.com", - #DOWN OR BROKEN: - "ddlanime.com", "fileforth.com", "loombo.com", "goldfile.eu", "putshare.com" + "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com" )) hoster_list -= (exclude_list) -- cgit v1.2.3 From 818ae3ce2c5ee6f47da2f508c786c3e2ab20ad45 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 12 Oct 2014 23:30:34 +0200 Subject: [XFileSharingPro] Match option --- module/plugins/hooks/XFileSharingPro.py | 79 +++++++++++++++++++++------------ 1 file changed, 51 insertions(+), 28 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 44f2f544a..7b1b12549 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,52 +8,74 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.13" + __version__ = "0.14" __config__ = [("activated", "bool", "Activated", True), - ("load_default", "bool", "Include default (built-in) hoster list", True), + ("match", "Always;Always except excluded;Listed only", "Match", "Always except excluded"), + ("load_default", "bool", "Include built-in hoster list", True), ("include_hosters", "str", "Include hosters (comma separated)", ""), ("exclude_hosters", "str", "Exclude hosters (comma separated)", "")] __description__ = """XFileSharingPro hook plugin""" __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("Walter Purcaro", "vuolter@gmail.com")] + + + event_list = ["pluginConfigChanged"] + + + def pluginConfigChanged(self, plugin, name, value): + if name != "activated": + self.loadPattern() def coreReady(self): - self.loadPattern() + self.pluginConfigChanged(self.__name__, "coreReady", None) def loadPattern(self): hoster_list = self.getConfigSet('include_hosters') exclude_list = self.getConfigSet('exclude_hosters') - if self.getConfig('load_default'): - hoster_list |= set(( - #WORKING HOSTERS: - "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", - "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", - #NOT TESTED: - "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", - "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", - "vidbull.com", "zalaa.com", "zomgupload.com", - #NOT WORKING: - "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com" - )) - - hoster_list -= (exclude_list) - hoster_list -= set(('', u'')) - - if not hoster_list: - self.unload() - return - - regexp = r'http://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}' % ('|'.join(sorted(hoster_list)).replace('.', '\.')) + if self.getConfig("match") != "Listed only": + if self.getConfig("match") == "Always": + match_list = "" + else: + match_list = '|'.join(sorted(exclude_list)) + self.logDebug("Excluding %d hosters" % len(exclude_list), match_list.replace('|', ', ')) + + regexp = r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z])+(?:\:\d+)?)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') + + else: + if self.getConfig('load_default'): + hoster_list |= set(( + #WORKING HOSTERS: + "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", + "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + #NOT TESTED: + "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", + "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", + "vidbull.com", "zalaa.com", "zomgupload.com", + #NOT WORKING: + "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com" + )) + + hoster_list -= (exclude_list) + hoster_list -= set(('', u'')) + + if not hoster_list: + self.unload() + return + + match_list = '|'.join(sorted(hoster_list)) + regexp = r'https?://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') + self.logDebug("Handling %d hosters" % len(hoster_list), match_list.replace('|', ', ')) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict['pattern'] = regexp dict['re'] = re.compile(regexp) - self.logDebug("Pattern loaded - handling %d hosters" % len(hoster_list)) + self.logDebug("Pattern loaded") def getConfigSet(self, option): @@ -62,6 +84,7 @@ class XFileSharingPro(Hook): def unload(self): + regexp = r'^unmatchable$' dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] - dict['pattern'] = r'^unmatchable$' - dict['re'] = re.compile(r'^unmatchable$') + dict['pattern'] = regexp + dict['re'] = re.compile(regexp) -- cgit v1.2.3 From 7a491109ba2f784ae7a41b89090dae14e2fbe4b5 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 12 Oct 2014 23:33:27 +0200 Subject: [XFileSharingPro] Code cosmetics --- module/plugins/hooks/XFileSharingPro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 7b1b12549..13d11155c 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -31,7 +31,7 @@ class XFileSharingPro(Hook): def coreReady(self): - self.pluginConfigChanged(self.__name__, "coreReady", None) + self.loadPattern() def loadPattern(self): -- cgit v1.2.3 From 7598810800c20b928265c63b207daa7c7caa04c6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 12 Oct 2014 23:40:26 +0200 Subject: [XFileSharingPro] Code cosmetics 2 --- module/plugins/hooks/XFileSharingPro.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 13d11155c..1d7864390 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -24,6 +24,16 @@ class XFileSharingPro(Hook): event_list = ["pluginConfigChanged"] + HOSTER_LIST = [#WORKING HOSTERS: + "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", + "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + #NOT TESTED: + "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", + "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", + "vidbull.com", "zalaa.com", "zomgupload.com", + #NOT WORKING: + "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] + def pluginConfigChanged(self, plugin, name, value): if name != "activated": @@ -49,17 +59,7 @@ class XFileSharingPro(Hook): else: if self.getConfig('load_default'): - hoster_list |= set(( - #WORKING HOSTERS: - "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", - "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", - #NOT TESTED: - "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", - "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", - "vidbull.com", "zalaa.com", "zomgupload.com", - #NOT WORKING: - "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com" - )) + hoster_list |= set(self.HOSTER_LIST) hoster_list -= (exclude_list) hoster_list -= set(('', u'')) -- cgit v1.2.3 From 70017d6c628d5a53bc61c4a3ed648dcb22354977 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 13 Oct 2014 00:20:16 +0200 Subject: [XFileSharingPro] Fix regexp --- module/plugins/hooks/XFileSharingPro.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 1d7864390..232c893cc 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" __config__ = [("activated", "bool", "Activated", True), ("match", "Always;Always except excluded;Listed only", "Match", "Always except excluded"), @@ -45,23 +45,26 @@ class XFileSharingPro(Hook): def loadPattern(self): - hoster_list = self.getConfigSet('include_hosters') - exclude_list = self.getConfigSet('exclude_hosters') + include_hosters = self.getConfigSet('include_hosters') + exclude_hosters = self.getConfigSet('exclude_hosters') if self.getConfig("match") != "Listed only": if self.getConfig("match") == "Always": match_list = "" else: - match_list = '|'.join(sorted(exclude_list)) - self.logDebug("Excluding %d hosters" % len(exclude_list), match_list.replace('|', ', ')) + hoster_list = exclude_hosters - set(('', u'')) + match_list = '|'.join(sorted(hoster_list)) + self.logDebug("Excluding %d hosters" % len(hoster_list), match_list.replace('|', ', ')) - regexp = r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z])+(?:\:\d+)?)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') + regexp = r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') else: + hoster_list = include_hosters + if self.getConfig('load_default'): hoster_list |= set(self.HOSTER_LIST) - hoster_list -= (exclude_list) + hoster_list -= exclude_hosters hoster_list -= set(('', u'')) if not hoster_list: @@ -69,9 +72,10 @@ class XFileSharingPro(Hook): return match_list = '|'.join(sorted(hoster_list)) - regexp = r'https?://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') self.logDebug("Handling %d hosters" % len(hoster_list), match_list.replace('|', ', ')) + regexp = r'https?://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') + dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict['pattern'] = regexp dict['re'] = re.compile(regexp) -- cgit v1.2.3 From 77ef3e137d2d9222d0f8965adf374e6712123a99 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 14 Oct 2014 13:07:19 +0200 Subject: [XFSPHoster] TEXT_ENCODING support --- module/plugins/hooks/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 232c893cc..f5d40dd62 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -11,12 +11,12 @@ class XFileSharingPro(Hook): __version__ = "0.15" __config__ = [("activated", "bool", "Activated", True), - ("match", "Always;Always except excluded;Listed only", "Match", "Always except excluded"), + ("match", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), ("load_default", "bool", "Include built-in hoster list", True), ("include_hosters", "str", "Include hosters (comma separated)", ""), ("exclude_hosters", "str", "Exclude hosters (comma separated)", "")] - __description__ = """XFileSharingPro hook plugin""" + __description__ = """Load XFileSharingPro based hosters which don't need a own plugin to work fine""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), ("Walter Purcaro", "vuolter@gmail.com")] -- cgit v1.2.3 From fe490d4542b78cb52b0db3c037ac71bc07aedfce Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Oct 2014 20:54:17 +0200 Subject: [XFileSharingPro] Updated to support XFileSharingProFolder --- module/plugins/hooks/XFileSharingPro.py | 82 +++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 35 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index f5d40dd62..62a5791b7 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,15 +8,18 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" __config__ = [("activated", "bool", "Activated", True), - ("match", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), - ("load_default", "bool", "Include built-in hoster list", True), + ("match_hoster", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), + ("match_crypter", "Always;Always except excluded;Listed only", "Crypter match", "Always except excluded"), + ("load_default", "bool", "Include built-in lists", True), ("include_hosters", "str", "Include hosters (comma separated)", ""), - ("exclude_hosters", "str", "Exclude hosters (comma separated)", "")] + ("exclude_hosters", "str", "Exclude hosters (comma separated)", ""), + ("include_crypters", "str", "Include crypters (comma separated)", ""), + ("exclude_crypters", "str", "Exclude crypters (comma separated)", "")] - __description__ = """Load XFileSharingPro based hosters which don't need a own plugin to work fine""" + __description__ = """Load hosters and crypter, based upon XFileSharingPro, which don't need a own plugin to work fine""" __license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), ("Walter Purcaro", "vuolter@gmail.com")] @@ -33,6 +36,7 @@ class XFileSharingPro(Hook): "vidbull.com", "zalaa.com", "zomgupload.com", #NOT WORKING: "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] + CRYPTER_LIST = [] def pluginConfigChanged(self, plugin, name, value): @@ -45,41 +49,48 @@ class XFileSharingPro(Hook): def loadPattern(self): - include_hosters = self.getConfigSet('include_hosters') - exclude_hosters = self.getConfigSet('exclude_hosters') + regex = {'hoster' = (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', + r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}'), + 'crypter' = (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', + r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} + + for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): + match = self.getConfig('match_%ss' % type) + include_set = self.getConfigSet('include_%ss' % type) + exclude_set = self.getConfigSet('exclude_%ss' % type) + + if match != "Listed only": + if match == "Always": + match_list = "" + else: + hoster_list = exclude_set - set(('', u'')) + match_list = '|'.join(sorted(hoster_list)) + self.logDebug("Excluding %d %ss" % (len(hoster_list), type), match_list.replace('|', ', ')) + + regexp = regex[type][0] % match_list.replace('.', '\.') - if self.getConfig("match") != "Listed only": - if self.getConfig("match") == "Always": - match_list = "" else: - hoster_list = exclude_hosters - set(('', u'')) - match_list = '|'.join(sorted(hoster_list)) - self.logDebug("Excluding %d hosters" % len(hoster_list), match_list.replace('|', ', ')) - - regexp = r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') + hoster_list = include_set - else: - hoster_list = include_hosters + if self.getConfig('load_default'): + hoster_list |= set(getattr(self, "%s_LIST" % type.upper())) - if self.getConfig('load_default'): - hoster_list |= set(self.HOSTER_LIST) + hoster_list -= exclude_set + hoster_list -= set(('', u'')) - hoster_list -= exclude_hosters - hoster_list -= set(('', u'')) + if not hoster_list: + self.unload() + return - if not hoster_list: - self.unload() - return - - match_list = '|'.join(sorted(hoster_list)) - self.logDebug("Handling %d hosters" % len(hoster_list), match_list.replace('|', ', ')) + match_list = '|'.join(sorted(hoster_list)) + self.logDebug("Handling %d %ss" % (len(hoster_list), type), match_list.replace('|', ', ')) - regexp = r'https?://(?:[^/]*\.)?(%s)/(?:embed-)?\w{12}' % match_list.replace('.', '\.') + regexp = regex[type][1] % match_list.replace('.', '\.') - dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] - dict['pattern'] = regexp - dict['re'] = re.compile(regexp) - self.logDebug("Pattern loaded") + dict = self.core.pluginManager.plugins[type][plugin] + dict['pattern'] = regexp + dict['re'] = re.compile(regexp) + self.logDebug("Pattern loaded for %ss" % type) def getConfigSet(self, option): @@ -89,6 +100,7 @@ class XFileSharingPro(Hook): def unload(self): regexp = r'^unmatchable$' - dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] - dict['pattern'] = regexp - dict['re'] = re.compile(regexp) + for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): + dict = self.core.pluginManager.plugins[type][plugin] + dict['pattern'] = regexp + dict['re'] = re.compile(regexp) -- cgit v1.2.3 From 6a6373e9b63ce7943f1a6592a641e3d8b3f31e09 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 17 Oct 2014 21:10:40 +0200 Subject: Fix TRAFFIC_LEFT_PATTERN in RapidfileshareNet and TusfilesNet accounts --- module/plugins/hooks/XFileSharingPro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 62a5791b7..44d376905 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -28,7 +28,7 @@ class XFileSharingPro(Hook): event_list = ["pluginConfigChanged"] HOSTER_LIST = [#WORKING HOSTERS: - "eyesfile.co", "eyesfile.com", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", + "eyesfile.ca", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", -- cgit v1.2.3 From ca835310c633fd19e3954ea9b6a0388d8529b368 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 18 Oct 2014 17:47:29 +0200 Subject: [XFileSharingPro] Improve hook regex --- module/plugins/hooks/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 44d376905..1782456e1 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.16" + __version__ = "0.17" __config__ = [("activated", "bool", "Activated", True), ("match_hoster", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), @@ -50,7 +50,7 @@ class XFileSharingPro(Hook): def loadPattern(self): regex = {'hoster' = (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', - r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}'), + r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), 'crypter' = (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} -- cgit v1.2.3 From 39b304c6495e6a77562e9ce2c9cdf921851c668a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Oct 2014 16:28:10 +0200 Subject: Fixes --- module/plugins/hooks/XFileSharingPro.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 1782456e1..54d97de53 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.17" + __version__ = "0.18" __config__ = [("activated", "bool", "Activated", True), ("match_hoster", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), @@ -49,13 +49,13 @@ class XFileSharingPro(Hook): def loadPattern(self): - regex = {'hoster' = (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', - r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), - 'crypter' = (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', - r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} + regex = {'hoster' : (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', + r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), + 'crypter': (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', + r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): - match = self.getConfig('match_%ss' % type) + match = self.getConfig('match_%s' % type) include_set = self.getConfigSet('include_%ss' % type) exclude_set = self.getConfigSet('exclude_%ss' % type) -- cgit v1.2.3 From 65317e4807e564ef527b7694335a771db0fa5ad0 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 26 Oct 2014 02:38:48 +0200 Subject: [XFileSharingPro] Added filevice.com to HOSTER_LIST --- module/plugins/hooks/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 54d97de53..691af8d4c 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.18" + __version__ = "0.19" __config__ = [("activated", "bool", "Activated", True), ("match_hoster", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), @@ -28,7 +28,7 @@ class XFileSharingPro(Hook): event_list = ["pluginConfigChanged"] HOSTER_LIST = [#WORKING HOSTERS: - "eyesfile.ca", "fileband.com", "filedwon.com", "hostingbulk.com", "linestorage.com", + "eyesfile.ca", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", "linestorage.com", "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", -- cgit v1.2.3 From 34984dae733c3f3d47b41a0acfba3724d53c65a1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 28 Oct 2014 16:52:10 +0100 Subject: Code cosmetics: plugin class attributes --- module/plugins/hooks/XFileSharingPro.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 691af8d4c..0259cbee7 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -6,8 +6,8 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): - __name__ = "XFileSharingPro" - __type__ = "hook" + __name__ = "XFileSharingPro" + __type__ = "hook" __version__ = "0.19" __config__ = [("activated", "bool", "Activated", True), @@ -20,9 +20,9 @@ class XFileSharingPro(Hook): ("exclude_crypters", "str", "Exclude crypters (comma separated)", "")] __description__ = """Load hosters and crypter, based upon XFileSharingPro, which don't need a own plugin to work fine""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("Walter Purcaro", "vuolter@gmail.com")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), + ("Walter Purcaro", "vuolter@gmail.com")] event_list = ["pluginConfigChanged"] -- cgit v1.2.3 From 57ac823aabc7d58771bd6c215e6ed1f44098199c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 30 Oct 2014 17:19:33 +0100 Subject: [XFileSharingPro] Massive cleanup for hook plugin --- module/plugins/hooks/XFileSharingPro.py | 79 +++++++++++++-------------------- 1 file changed, 30 insertions(+), 49 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 0259cbee7..3c35adedb 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,28 +8,29 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.19" + __version__ = "0.20" __config__ = [("activated", "bool", "Activated", True), - ("match_hoster", "Always;Always except excluded;Listed only", "Hoster match", "Always except excluded"), - ("match_crypter", "Always;Always except excluded;Listed only", "Crypter match", "Always except excluded"), - ("load_default", "bool", "Include built-in lists", True), - ("include_hosters", "str", "Include hosters (comma separated)", ""), - ("exclude_hosters", "str", "Exclude hosters (comma separated)", ""), - ("include_crypters", "str", "Include crypters (comma separated)", ""), - ("exclude_crypters", "str", "Exclude crypters (comma separated)", "")] - - __description__ = """Load hosters and crypter, based upon XFileSharingPro, which don't need a own plugin to work fine""" + ("every_hoster", "bool", "Try to hook any hoster", True), + ("every_crypter", "bool", "Try to hook any crypter", True), + ("load_default", "bool", "Load built-in plugins", True), + ("hoster_list", "str", "Load hosters (comma separated)", ""), + ("crypter_list", "str", "Load crypters (comma separated)", "")] + + __description__ = """Load XFileSharingPro based hosters and crypter which don't need a own plugin to run""" __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("Walter Purcaro", "vuolter@gmail.com")] + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - event_list = ["pluginConfigChanged"] + # event_list = ["pluginConfigChanged"] + regex = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', + r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), + 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', + r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} HOSTER_LIST = [#WORKING HOSTERS: - "eyesfile.ca", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", "linestorage.com", - "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", + "linestorage.com", "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", @@ -39,9 +40,8 @@ class XFileSharingPro(Hook): CRYPTER_LIST = [] - def pluginConfigChanged(self, plugin, name, value): - if name != "activated": - self.loadPattern() + # def pluginConfigChanged(self, plugin, name, value): + # self.loadPattern() def coreReady(self): @@ -49,53 +49,34 @@ class XFileSharingPro(Hook): def loadPattern(self): - regex = {'hoster' : (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', - r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), - 'crypter': (r'https?://(?!(?:www\.)?(?:%s))(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', - r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} - for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): - match = self.getConfig('match_%s' % type) - include_set = self.getConfigSet('include_%ss' % type) - exclude_set = self.getConfigSet('exclude_%ss' % type) - - if match != "Listed only": - if match == "Always": - match_list = "" - else: - hoster_list = exclude_set - set(('', u'')) - match_list = '|'.join(sorted(hoster_list)) - self.logDebug("Excluding %d %ss" % (len(hoster_list), type), match_list.replace('|', ', ')) - - regexp = regex[type][0] % match_list.replace('.', '\.') + every_plugin = self.getConfig('every_%s' % type) + if every_plugin: + regexp = self.regex[type][0] else: - hoster_list = include_set + s = self.getConfig('%s_list' % type).replace('\\', '').replace('|', ',').replace(';', ',').lower() + plugin_list = set([x.strip() for x in s.split(',')]) if self.getConfig('load_default'): - hoster_list |= set(getattr(self, "%s_LIST" % type.upper())) + plugin_list |= set([x.lower() for x in getattr(self, "%s_LIST" % type.upper())]) - hoster_list -= exclude_set - hoster_list -= set(('', u'')) + plugin_list -= set(('', u'')) - if not hoster_list: + if not plugin_list: self.unload() return - match_list = '|'.join(sorted(hoster_list)) - self.logDebug("Handling %d %ss" % (len(hoster_list), type), match_list.replace('|', ', ')) + match_list = '|'.join(sorted(plugin_list)) + self.logInfo("Handling %d %ss: %s" % (len(plugin_list), type, match_list.replace('|', ', '))) - regexp = regex[type][1] % match_list.replace('.', '\.') + regexp = self.regex[type][1] % match_list #.replace('.', '\.') dict = self.core.pluginManager.plugins[type][plugin] dict['pattern'] = regexp dict['re'] = re.compile(regexp) - self.logDebug("Pattern loaded for %ss" % type) - - def getConfigSet(self, option): - s = self.getConfig(option).lower().replace('|', ',').replace(';', ',') - return set([x.strip() for x in s.split(',')]) + self.logDebug("Loaded %s regex: `%s`" % (type, regexp)) def unload(self): -- cgit v1.2.3 From dbcec9627ab27c0493fd277b93f08504a90cefe6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 1 Nov 2014 18:48:07 +0100 Subject: [XFileSharingPro] Tiny code cosmetics --- module/plugins/hooks/XFileSharingPro.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 3c35adedb..552730f5d 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -53,6 +53,7 @@ class XFileSharingPro(Hook): every_plugin = self.getConfig('every_%s' % type) if every_plugin: + self.logInfo("Handling all %ss: %s" % (len(plugin_list), type, match_list.replace('|', ', '))) regexp = self.regex[type][0] else: s = self.getConfig('%s_list' % type).replace('\\', '').replace('|', ',').replace(';', ',').lower() @@ -68,9 +69,9 @@ class XFileSharingPro(Hook): return match_list = '|'.join(sorted(plugin_list)) - self.logInfo("Handling %d %ss: %s" % (len(plugin_list), type, match_list.replace('|', ', '))) + self.logInfo("Handling %s %ss" % (u'\u221E', type)) - regexp = self.regex[type][1] % match_list #.replace('.', '\.') + regexp = self.regex[type][1] % match_list.replace('.', '\.') dict = self.core.pluginManager.plugins[type][plugin] dict['pattern'] = regexp -- cgit v1.2.3 From 0c65a1e6c6ffa739731e3101dcac1dc5d728c9ad Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 2 Nov 2014 22:41:04 +0100 Subject: [XFileSharingPro] Fix hook plugin --- module/plugins/hooks/XFileSharingPro.py | 60 +++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 25 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 552730f5d..c4205b34f 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,14 +8,14 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.20" + __version__ = "0.21" __config__ = [("activated", "bool", "Activated", True), - ("every_hoster", "bool", "Try to hook any hoster", True), - ("every_crypter", "bool", "Try to hook any crypter", True), - ("load_default", "bool", "Load built-in plugins", True), - ("hoster_list", "str", "Load hosters (comma separated)", ""), - ("crypter_list", "str", "Load crypters (comma separated)", "")] + ("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), + ("hoster_list", "str", "Hoster list (comma separated)", ""), + ("crypter_list", "str", "Crypter list (comma separated)", "")] __description__ = """Load XFileSharingPro based hosters and crypter which don't need a own plugin to run""" __license__ = "GPLv3" @@ -23,7 +23,7 @@ class XFileSharingPro(Hook): # event_list = ["pluginConfigChanged"] - regex = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', + regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} @@ -40,7 +40,7 @@ class XFileSharingPro(Hook): CRYPTER_LIST = [] - # def pluginConfigChanged(self, plugin, name, value): + # def pluginConfigChanged(self.__name__, plugin, name, value): # self.loadPattern() @@ -49,40 +49,50 @@ class XFileSharingPro(Hook): def loadPattern(self): - for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): - every_plugin = self.getConfig('every_%s' % type) + use_builtin_list = self.getConfig('use_builtin_list') + + for type, plugin in (("hoster", "XFileSharingPro"), + ("crypter", "XFileSharingProFolder")): + every_plugin = not self.getConfig("use_%s_list" % type) if every_plugin: - self.logInfo("Handling all %ss: %s" % (len(plugin_list), type, match_list.replace('|', ', '))) - regexp = self.regex[type][0] + self.logInfo(_("Handling any %s I can!") % type) + pattern = self.regexp[type][0] else: s = self.getConfig('%s_list' % type).replace('\\', '').replace('|', ',').replace(';', ',').lower() plugin_list = set([x.strip() for x in s.split(',')]) - if self.getConfig('load_default'): + if use_builtin_list: plugin_list |= set([x.lower() for x in getattr(self, "%s_LIST" % type.upper())]) - plugin_list -= set(('', u'')) + plugin_list -= set(('', u'') if not plugin_list: - self.unload() + self.logInfo(_("No %s to handle") % type) + self._unload(type, plugin) return match_list = '|'.join(sorted(plugin_list)) - self.logInfo("Handling %s %ss" % (u'\u221E', type)) - regexp = self.regex[type][1] % match_list.replace('.', '\.') + len_match_list = len(plugin_list) + self.logInfo(_("Handling %d %s%s: %s") % (len_match_list, type, "" if len_match_list is 1 else "s", match_list.replace('|', ', '))) + + pattern = self.regexp[type][1] % match_list.replace('.', '\.') dict = self.core.pluginManager.plugins[type][plugin] - dict['pattern'] = regexp - dict['re'] = re.compile(regexp) + dict['pattern'] = pattern + dict['re'] = re.compile(pattern) + + self.logDebug("Loaded %s pattern: %s" % (type, pattern)) - self.logDebug("Loaded %s regex: `%s`" % (type, regexp)) + + def _unload(self, type, plugin): + dict = self.core.pluginManager.plugins[type][plugin] + dict['pattern'] = r'^unmatchable$' + dict['re'] = re.compile(dict['pattern']) def unload(self): - regexp = r'^unmatchable$' - for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): - dict = self.core.pluginManager.plugins[type][plugin] - dict['pattern'] = regexp - dict['re'] = re.compile(regexp) + for type, plugin in (("hoster", "XFileSharingPro"), + ("crypter", "XFileSharingProFolder")): + self._unload(type, plugin) -- cgit v1.2.3 From 57e7d7049a569bc96e7bdf135a2d40df520cf3b3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 3 Nov 2014 13:04:22 +0100 Subject: [XFileSharingPro] Fix typo --- module/plugins/hooks/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index c4205b34f..55fb5948a 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.21" + __version__ = "0.22" __config__ = [("activated", "bool", "Activated", True), ("use_hoster_list", "bool", "Load listed hosters only", False), @@ -65,7 +65,7 @@ class XFileSharingPro(Hook): if use_builtin_list: plugin_list |= set([x.lower() for x in getattr(self, "%s_LIST" % type.upper())]) - plugin_list -= set(('', u'') + plugin_list -= set(('', u'')) if not plugin_list: self.logInfo(_("No %s to handle") % type) -- cgit v1.2.3 From edfaaed90d59991ada592da31a65cc518d7d3871 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 4 Nov 2014 03:23:39 +0100 Subject: Code cosmetics --- module/plugins/hooks/XFileSharingPro.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 55fb5948a..6e9962f3c 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -28,15 +28,15 @@ class XFileSharingPro(Hook): 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} - HOSTER_LIST = [#WORKING HOSTERS: - "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", - "linestorage.com", "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", - #NOT TESTED: - "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", - "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", - "vidbull.com", "zalaa.com", "zomgupload.com", - #NOT WORKING: - "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] + HOSTER_LIST = [#WORKING HOSTERS: + "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", + "linestorage.com", "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + #NOT TESTED: + "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", + "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", + "vidbull.com", "zalaa.com", "zomgupload.com", + #NOT WORKING: + "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] CRYPTER_LIST = [] -- cgit v1.2.3 From f74309f89923317eeaaca31d74dff10590ed3d40 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 4 Nov 2014 23:42:46 +0100 Subject: [XFSHoster] Use URL_REPLACEMENTS to clean url --- module/plugins/hooks/XFileSharingPro.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 6e9962f3c..ddc20b98a 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -24,9 +24,9 @@ class XFileSharingPro(Hook): # event_list = ["pluginConfigChanged"] regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', - r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), - 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', - r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} + r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), + 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', + r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} HOSTER_LIST = [#WORKING HOSTERS: "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", -- cgit v1.2.3 From 8f02f78f4ffa8f4aef604b905e3fd06e1647a359 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 23 Nov 2014 05:55:21 +0100 Subject: [XFileSharingPro] Improve hooks patterns --- module/plugins/hooks/XFileSharingPro.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index ddc20b98a..47163d2fd 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.22" + __version__ = "0.23" __config__ = [("activated", "bool", "Activated", True), ("use_hoster_list", "bool", "Load listed hosters only", False), @@ -23,8 +23,8 @@ class XFileSharingPro(Hook): # event_list = ["pluginConfigChanged"] - regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}', - r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w{12}\W?'), + regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}(?:[\W_ ]|$)', + r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w+'), 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} -- cgit v1.2.3 From f47b649a005045e62bc34720c0d39c4cfb8edaa3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 23 Nov 2014 12:54:15 +0100 Subject: [BasePlugin] Fix typo --- module/plugins/hooks/XFileSharingPro.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 47163d2fd..fd1fa760e 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -23,7 +23,7 @@ class XFileSharingPro(Hook): # event_list = ["pluginConfigChanged"] - regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}(?:[\W_ ]|$)', + regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)', r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w+'), 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} -- cgit v1.2.3 From 325d5dd81226c9e1ca58e0e9e72052ed08b1ff50 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 24 Nov 2014 01:10:05 +0100 Subject: [XFileSharingPro] Temp disable universal hook feature --- module/plugins/hooks/XFileSharingPro.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index fd1fa760e..ab5086664 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,11 +8,11 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.23" + __version__ = "0.24" __config__ = [("activated", "bool", "Activated", True), - ("use_hoster_list", "bool", "Load listed hosters only", False), - ("use_crypter_list", "bool", "Load listed crypters only", False), + ("use_hoster_list", "bool", "Load listed hosters only", True), + ("use_crypter_list", "bool", "Load listed crypters only", True), ("use_builtin_list", "bool", "Load built-in plugin list", True), ("hoster_list", "str", "Hoster list (comma separated)", ""), ("crypter_list", "str", "Crypter list (comma separated)", "")] -- cgit v1.2.3 From f000404049d065b36eeede90dbdfda6e81b604e6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 6 Dec 2014 11:03:17 +0100 Subject: [XFileSharingPro] Improve regexp --- module/plugins/hooks/XFileSharingPro.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index ab5086664..fe955beb9 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,11 +8,11 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.24" + __version__ = "0.25" __config__ = [("activated", "bool", "Activated", True), ("use_hoster_list", "bool", "Load listed hosters only", True), - ("use_crypter_list", "bool", "Load listed crypters only", True), + ("use_crypter_list", "bool", "Load listed crypters only", False), ("use_builtin_list", "bool", "Load built-in plugin list", True), ("hoster_list", "str", "Hoster list (comma separated)", ""), ("crypter_list", "str", "Crypter list (comma separated)", "")] @@ -23,9 +23,9 @@ class XFileSharingPro(Hook): # event_list = ["pluginConfigChanged"] - regexp = {'hoster' : (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)', + regexp = {'hoster' : (r'https?://(?:www\.)?([\w.^_]+(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)', r'https?://(?:[^/]+\.)?(%s)/(?:embed-)?\w+'), - 'crypter': (r'https?://(?:www\.)?([\w^_]+(?:\.[a-zA-Z]{2,})+(?:\:\d+)?)/(?:user|folder)s?/\w+', + 'crypter': (r'https?://(?:www\.)?([\w.^_]+(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} HOSTER_LIST = [#WORKING HOSTERS: -- cgit v1.2.3 From e4c9e4ffc9e3f6bd6b16ce83796dc3d275d544f7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 9 Dec 2014 01:13:05 +0100 Subject: Don't start unused periodical in some addons --- module/plugins/hooks/XFileSharingPro.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index fe955beb9..e9b1b454e 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.25" + __version__ = "0.26" __config__ = [("activated", "bool", "Activated", True), ("use_hoster_list", "bool", "Load listed hosters only", True), @@ -44,6 +44,11 @@ class XFileSharingPro(Hook): # self.loadPattern() + #@TODO: Remove in 0.4.10 + def initPeriodical(self): + pass + + def coreReady(self): self.loadPattern() -- cgit v1.2.3 From d799ef7a401149591b747e18197ce54017f96f1b Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 23:47:33 +0100 Subject: [LinestorageCom] Added hoster plugin --- module/plugins/hooks/XFileSharingPro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index e9b1b454e..10de43cc0 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,7 +8,7 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.26" + __version__ = "0.27" __config__ = [("activated", "bool", "Activated", True), ("use_hoster_list", "bool", "Load listed hosters only", True), @@ -30,7 +30,7 @@ class XFileSharingPro(Hook): HOSTER_LIST = [#WORKING HOSTERS: "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", - "linestorage.com", "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", -- cgit v1.2.3 From c10f5af761319b239381a24e2cf2f418e20d8744 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 22 Dec 2014 16:56:35 +0100 Subject: [XFileSharingPro] Support salefiles.com --- module/plugins/hooks/XFileSharingPro.py | 36 +++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 10de43cc0..946838e47 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -8,10 +8,10 @@ from module.plugins.Hook import Hook class XFileSharingPro(Hook): __name__ = "XFileSharingPro" __type__ = "hook" - __version__ = "0.27" + __version__ = "0.28" __config__ = [("activated", "bool", "Activated", True), - ("use_hoster_list", "bool", "Load listed hosters only", True), + ("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), ("hoster_list", "str", "Hoster list (comma separated)", ""), @@ -30,7 +30,7 @@ class XFileSharingPro(Hook): HOSTER_LIST = [#WORKING HOSTERS: "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", - "ravishare.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + "ravishare.com", "salefiles.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", #NOT TESTED: "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", @@ -80,7 +80,10 @@ class XFileSharingPro(Hook): match_list = '|'.join(sorted(plugin_list)) len_match_list = len(plugin_list) - self.logInfo(_("Handling %d %s%s: %s") % (len_match_list, type, "" if len_match_list is 1 else "s", match_list.replace('|', ', '))) + self.logInfo(_("Handling %d %s%s: %s") % (len_match_list, + type, + "" if len_match_list is 1 else "s", + match_list.replace('|', ', '))) pattern = self.regexp[type][1] % match_list.replace('.', '\.') @@ -98,6 +101,31 @@ class XFileSharingPro(Hook): def unload(self): + # self.unloadHoster("BasePlugin") for type, plugin in (("hoster", "XFileSharingPro"), ("crypter", "XFileSharingProFolder")): self._unload(type, plugin) + + + def unloadHoster(self, hoster): + hdict = self.core.pluginManager.hosterPlugins[hoster] + if "new_name" in hdict and hdict['new_name'] is "XFileSharingPro": + if "module" in hdict: + del hdict['module'] + + if "new_module" in hdict: + del hdict['new_module'] + del hdict['new_name'] + + return True + else: + return False + + + # def downloadFailed(self, pyfile): + # if pyfile.pluginname is "BasePlugin" \ + # and pyfile.hasStatus("failed") \ + # and not self.getConfig("use_hoster_list") \ + # and self.unloadHoster("BasePlugin"): + # self.logDebug("Unloaded XFileSharingPro from BasePlugin") + # pyfile.setStatus("queued") -- cgit v1.2.3 From 57a319563651a07bf8265ab52da0d7375191319c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 23 Dec 2014 13:13:42 +0100 Subject: Rename MultiHoster plugin to MultiHook --- module/plugins/hooks/XFileSharingPro.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 946838e47..589143547 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -10,12 +10,12 @@ class XFileSharingPro(Hook): __type__ = "hook" __version__ = "0.28" - __config__ = [("activated", "bool", "Activated", True), - ("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), - ("hoster_list", "str", "Hoster list (comma separated)", ""), - ("crypter_list", "str", "Crypter list (comma separated)", "")] + __config__ = [("activated" , "bool", "Activated" , True ), + ("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 ), + ("hoster_list" , "str" , "Hoster list (comma separated)" , "" ), + ("crypter_list" , "str" , "Crypter list (comma separated)", "" )] __description__ = """Load XFileSharingPro based hosters and crypter which don't need a own plugin to run""" __license__ = "GPLv3" -- cgit v1.2.3 From 575ce629081995766a231f0a9f3e97e3b79d23b1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 21:20:59 +0100 Subject: Update MultiHook based hooks --- module/plugins/hooks/XFileSharingPro.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'module/plugins/hooks/XFileSharingPro.py') diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index 589143547..79e373ad3 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -28,16 +28,16 @@ class XFileSharingPro(Hook): 'crypter': (r'https?://(?:www\.)?([\w.^_]+(?:\.[a-zA-Z]{2,})(?:\:\d+)?)/(?:user|folder)s?/\w+', r'https?://(?:[^/]+\.)?(%s)/(?:user|folder)s?/\w+')} - HOSTER_LIST = [#WORKING HOSTERS: - "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", - "ravishare.com", "salefiles.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", - #NOT TESTED: - "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", - "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", - "vidbull.com", "zalaa.com", "zomgupload.com", - #NOT WORKING: - "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] - CRYPTER_LIST = [] + HOSTER_BUILTIN = [#WORKING HOSTERS: + "eyesfile.ca", "file4safe.com", "fileband.com", "filedwon.com", "filevice.com", "hostingbulk.com", + "ravishare.com", "salefiles.com", "sharesix.com", "thefile.me", "verzend.be", "xvidstage.com", + #NOT TESTED: + "101shared.com", "4upfiles.com", "filemaze.ws", "filenuke.com", "linkzhost.com", "mightyupload.com", + "rockdizfile.com", "sharebeast.com", "sharerepo.com", "shareswift.com", "uploadbaz.com", "uploadc.com", + "vidbull.com", "zalaa.com", "zomgupload.com", + #NOT WORKING: + "amonshare.com", "banicrazy.info", "boosterking.com", "host4desi.com", "laoupload.com", "rd-fs.com"] + CRYPTER_BUILTIN = [] # def pluginConfigChanged(self.__name__, plugin, name, value): @@ -68,7 +68,7 @@ class XFileSharingPro(Hook): plugin_list = set([x.strip() for x in s.split(',')]) if use_builtin_list: - plugin_list |= set([x.lower() for x in getattr(self, "%s_LIST" % type.upper())]) + plugin_list |= set([x.lower() for x in getattr(self, "%s_BUILTIN" % type.upper())]) plugin_list -= set(('', u'')) -- cgit v1.2.3