diff options
| -rw-r--r-- | module/plugins/hooks/AlldebridCom.py | 19 | ||||
| -rw-r--r-- | module/plugins/hooks/EasybytezCom.py | 18 | ||||
| -rw-r--r-- | module/plugins/hooks/MultishareCz.py | 26 | ||||
| -rw-r--r-- | module/plugins/hooks/RealdebridCom.py | 20 | 
4 files changed, 58 insertions, 25 deletions
| diff --git a/module/plugins/hooks/AlldebridCom.py b/module/plugins/hooks/AlldebridCom.py index d3d6ff294..f9657ed8c 100644 --- a/module/plugins/hooks/AlldebridCom.py +++ b/module/plugins/hooks/AlldebridCom.py @@ -7,11 +7,13 @@ from module.plugins.internal.MultiHoster import MultiHoster  class AlldebridCom(MultiHoster):      __name__ = "AlldebridCom" -    __version__ = "0.1" +    __version__ = "0.11"      __type__ = "hook"      __config__ = [("activated", "bool", "Activated", "False"), -                  ("https", "bool", "Enable HTTPS", "False")] +                  ("https", "bool", "Enable HTTPS", "False"), +                  ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), +                  ("hosterList", "str", "Hoster list (comma separated)", "")]      __description__ = """Real-Debrid.com hook plugin"""      __author_name__ = ("Andy, Voigt") @@ -23,4 +25,15 @@ class AlldebridCom(MultiHoster):          https = "https" if self.getConfig("https") else "http"          page = getURL(https + "://www.alldebrid.com/api.php?action=get_host").replace("\"","").strip() -        return[x.strip() for x in page.split(",") if x.strip()] +        hosters = set([x.strip() for x in page.split(",") if x.strip()]) +         +        configMode = self.getConfig('hosterListMode') +        if configMode in ("listed", "unlisted"): +            configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(',')) +            configList.discard(u'') +            if configMode == "listed": +                hosters &= configList +            else: +                hosters -= configList +         +        return list(hosters) diff --git a/module/plugins/hooks/EasybytezCom.py b/module/plugins/hooks/EasybytezCom.py index 4dd39cca6..21a988555 100644 --- a/module/plugins/hooks/EasybytezCom.py +++ b/module/plugins/hooks/EasybytezCom.py @@ -11,11 +11,11 @@ def getConfigSet(option):  class EasybytezCom(MultiHoster):      __name__ = "EasybytezCom" -    __version__ = "0.01" +    __version__ = "0.02"      __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)", "")] +                  ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), +                  ("hosterList", "str", "Hoster list (comma separated)", "")]      __description__ = """EasyBytez.com hook plugin"""      __author_name__ = ("zoidberg")      __author_mail__ = ("zoidberg@mujmail.cz") @@ -24,9 +24,13 @@ class EasybytezCom(MultiHoster):          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) +        configMode = self.getConfig('hosterListMode') +        if configMode in ("listed", "unlisted"): +            configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(',')) +            configList.discard(u'') +            if configMode == "listed": +                hoster &= configList +            else: +                hoster -= configList          return list(hoster)
\ No newline at end of file diff --git a/module/plugins/hooks/MultishareCz.py b/module/plugins/hooks/MultishareCz.py index a934f43ef..a00c6cb2b 100644 --- a/module/plugins/hooks/MultishareCz.py +++ b/module/plugins/hooks/MultishareCz.py @@ -11,26 +11,30 @@ def getConfigSet(option):  class MultishareCz(MultiHoster):      __name__ = "MultishareCz" -    __version__ = "0.01" +    __version__ = "0.03"      __type__ = "hook"      __config__ = [("activated", "bool", "Activated", "False"), -        ("includeHoster", "str", "Use only for downloads from (bar-separated hosters)", ""), -        ("excludeHoster", "str", "Do not use for downloads from (bar-separated hosters)", "rapidshare.com|uloz.to")] +        ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), +        ("hosterList", "str", "Hoster list (comma separated)", "uloz.to")]      __description__ = """MultiShare.cz hook plugin"""      __author_name__ = ("zoidberg")      __author_mail__ = ("zoidberg@mujmail.cz") -    #replacements = [("freakshare.net", "freakshare.com")] -    HOSTER_PATTERN = r'<img class="logo-shareserveru"[^>]*alt="([^"]+)"></td>\s*<td class="stav"><img src="/img/loga/ok.png" alt="OK">' +    replacements = [("share-rapid.cz", "sharerapid.com")] +    HOSTER_PATTERN = r'<img class="logo-shareserveru"[^>]*?alt="([^"]+)"></td>\s*<td class="stav">[^>]*?alt="OK"'      def getHoster(self):          page = getURL("http://www.multishare.cz/monitoring/") -        hoster = set(m.group(1).lower() for m in re.finditer(self.HOSTER_PATTERN, page))  +        hosters = set(h.lower().strip() for h in re.findall(self.HOSTER_PATTERN, page))  -        option = self.getConfig('includeHoster').strip() -        if option: hoster &= getConfigSet(option) -        option = self.getConfig('excludeHoster').strip() -        if option: hoster -= getConfigSet(option) +        configMode = self.getConfig('hosterListMode') +        if configMode in ("listed", "unlisted"): +            configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(',')) +            configList.discard(u'') +            if configMode == "listed": +                hosters &= configList +            elif configMode == "unlisted": +                hosters -= configList -        return list(hoster)
\ No newline at end of file +        return list(hosters)
\ No newline at end of file diff --git a/module/plugins/hooks/RealdebridCom.py b/module/plugins/hooks/RealdebridCom.py index c57e3de52..bd3179673 100644 --- a/module/plugins/hooks/RealdebridCom.py +++ b/module/plugins/hooks/RealdebridCom.py @@ -5,12 +5,13 @@ from module.plugins.internal.MultiHoster import MultiHoster  class RealdebridCom(MultiHoster):      __name__ = "RealdebridCom" -    __version__ = "0.4" +    __version__ = "0.41"      __type__ = "hook"      __config__ = [("activated", "bool", "Activated", "False"), -                  ("https", "bool", "Enable HTTPS", "False")] - +                  ("https", "bool", "Enable HTTPS", "False"), +                  ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported):", "all"), +                  ("hosterList", "str", "Hoster list (comma separated)", "")]      __description__ = """Real-Debrid.com hook plugin"""      __author_name__ = ("Devirex, Hazzard")      __author_mail__ = ("naibaf_11@yahoo.de") @@ -21,4 +22,15 @@ class RealdebridCom(MultiHoster):          https = "https" if self.getConfig("https") else "http"          page = getURL(https + "://real-debrid.com/api/hosters.php").replace("\"","").strip() -        return[x.strip() for x in page.split(",") if x.strip()]
\ No newline at end of file +        hosters = set([x.strip() for x in page.split(",") if x.strip()]) +         +        configMode = self.getConfig('hosterListMode') +        if configMode in ("listed", "unlisted"): +            configList = set(self.getConfig('hosterList').strip().lower().replace('|',',').replace(';',',').split(',')) +            configList.discard(u'') +            if configMode == "listed": +                hosters &= configList +            else: +                hosters -= configList +         +        return list(hosters) | 
