diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2012-05-30 00:51:53 +0200 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2012-05-30 00:51:53 +0200 |
commit | 6cef4a9e0f7ee1c7649a4a2da45de99241645dd1 (patch) | |
tree | 61dfc77205e9c2a1d76227da819ff49aac204d1f /module/plugins/hooks/XFileSharingPro.py | |
parent | merge (diff) | |
download | pyload-6cef4a9e0f7ee1c7649a4a2da45de99241645dd1.tar.xz |
simple checksum and download scheduler hooks; keep config options ordered
Diffstat (limited to 'module/plugins/hooks/XFileSharingPro.py')
-rw-r--r-- | module/plugins/hooks/XFileSharingPro.py | 66 |
1 files changed, 37 insertions, 29 deletions
diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py index f4461f8c6..3981db2d0 100644 --- a/module/plugins/hooks/XFileSharingPro.py +++ b/module/plugins/hooks/XFileSharingPro.py @@ -5,41 +5,44 @@ import re class XFileSharingPro(Hook): __name__ = "XFileSharingPro" - __version__ = "0.02" + __version__ = "0.03" __type__ = "hook" - __config__ = [ ("activated", "bool", "Activated" , "True"), - ("loadDefault", "bool", "Load default hoster list" , "True"), + __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__ = """MultiShare.cz hook plugin""" + ("excludeList", "str", "Exclude hosters (comma separated)", "") ] + __description__ = """Hoster URL pattern loader for the generic XFileSharingPro plugin""" __author_name__ = ("zoidberg") - __author_mail__ = ("zoidberg@mujmail.cz") - + __author_mail__ = ("zoidberg@mujmail.cz") + def coreReady(self): + self.loadPattern() + + def loadPattern(self): hosterList = self.getConfigSet('includeList') excludeList = self.getConfigSet('excludeList') if self.getConfig('loadDefault'): hosterList |= set(( #WORKING HOSTERS: - "azsharing\.com", "banashare\.com", "fileband\.com", "kingsupload\.com", "migahost\.com", "ryushare.com", "xfileshare\.eu", + "azsharing.com", "banashare.com", "fileband.com", "kingsupload.com", "migahost.com", "ryushare.com", "xfileshare.eu", #NOT TESTED: - "aieshare\.com", "amonshare\.com", "asixfiles\.com", - "bebasupload\.com", "boosterking\.com", "buckshare\.com", "bulletupload\.com", "crocshare\.com", "ddlanime\.com", "divxme\.com", - "dopeshare\.com", "downupload\.com", "eyesfile\.com", "eyvx\.com", "fik1\.com", "file4safe\.com", "file4sharing\.com", - "fileforth\.com", "filemade\.com", "filemak\.com", "fileplaygroud\.com", "filerace\.com", "filestrack\.com", - "fileupper\.com", "filevelocity\.com", "fooget\.com", "4bytez\.com", "freefilessharing\.com", "glumbouploads\.com", "grupload\.com", - "heftyfile\.com", "hipfile\.com", "host4desi\.com", "hulkshare\.com", "idupin\.com", "imageporter\.com", "isharefast\.com", - "jalurcepat\.com", "laoupload\.com", "linkzhost\.com", "loombo\.com", "maknyos\.com", - "mlfat4arab\.com", "movreel\.com", "netuploaded\.com", "ok2upload\.com", "180upload\.com", "1hostclick\.com", "ovfile\.com", - "putshare\.com", "pyramidfiles\.com", "q4share\.com", "queenshare\.com", "ravishare\.com", "rockdizfile\.com", "sendmyway\.com", - "share76\.com", "sharebeast\.com", "sharehut\.com", "sharerun\.com", "shareswift\.com", "sharingonline\.com", "6ybh-upload\.com", - "skipfile\.com", "spaadyshare\.com", "space4file\.com", "speedoshare\.com", "uploadbaz\.com", "uploadboost\.com", "uploadc\.com", - "uploaddot\.com", "uploadfloor\.com", "uploadic\.com", "uploadville\.com", "uptobox\.com", "vidbull\.com", "zalaa\.com", - "zomgupload\\.com\.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", "kingshare\.to", "filemaze\.ws", "filehost\.ws", "goldfile\.eu", "filestock\.ru", "moidisk\.ru" - "4up\.me", "kfiles\.kz", "odsiebie\.pl", "upchi\.co\.il", "upit\.in", "verzend\.be" + "aieshare.com", "amonshare.com", "asixfiles.com", + "bebasupload.com", "boosterking.com", "buckshare.com", "bulletupload.com", "crocshare.com", "ddlanime.com", "divxme.com", + "dopeshare.com", "downupload.com", "eyesfile.com", "eyvx.com", "fik1.com", "file4safe.com", "file4sharing.com", + "fileforth.com", "filemade.com", "filemak.com", "fileplaygroud.com", "filerace.com", "filestrack.com", + "fileupper.com", "filevelocity.com", "fooget.com", "4bytez.com", "freefilessharing.com", "glumbouploads.com", "grupload.com", + "heftyfile.com", "hipfile.com", "host4desi.com", "hulkshare.com", "idupin.com", "imageporter.com", "isharefast.com", + "jalurcepat.com", "laoupload.com", "linkzhost.com", "loombo.com", "maknyos.com", + "mlfat4arab.com", "movreel.com", "netuploaded.com", "ok2upload.com", "180upload.com", "1hostclick.com", "ovfile.com", + "putshare.com", "pyramidfiles.com", "q4share.com", "queenshare.com", "ravishare.com", "rockdizfile.com", "sendmyway.com", + "share76.com", "sharebeast.com", "sharehut.com", "sharerun.com", "shareswift.com", "sharingonline.com", "6ybh-upload.com", + "skipfile.com", "spaadyshare.com", "space4file.com", "speedoshare.com", "uploadbaz.com", "uploadboost.com", "uploadc.com", + "uploaddot.com", "uploadfloor.com", "uploadic.com", "uploadville.com", "uptobox.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", "kingshare.to", "filemaze.ws", "filehost.ws", "goldfile.eu", "filestock.ru", "moidisk.ru" + "4up.me", "kfiles.kz", "odsiebie.pl", "upchi.co.il", "upit.in", "verzend.be" )) #NOT WORKING: @@ -50,17 +53,22 @@ class XFileSharingPro(Hook): hosterList -= set(('', u'')) if not hosterList: - self.logError("Hoster list is empty" % len(hosterList)) + self.unload() return - regexp = r"http://(?:[^/]*\.)?(%s)/\w{12}" % "|".join(sorted(hosterList)) - self.logDebug("Added %d hosters" % len(hosterList)) + regexp = r"http://(?:[^/]*\.)?(%s)/\w{12}" % ("|".join(sorted(hosterList)).replace('.','\.')) #self.logDebug(regexp) dict = self.core.pluginManager.hosterPlugins['XFileSharingPro'] dict["pattern"] = regexp 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(';',',').replace('.','\.') - return set([x.strip() for x in s.split('|')])
\ No newline at end of file + 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$" + dict["re"] = re.compile(r"^unmatchable$")
\ No newline at end of file |