diff options
Diffstat (limited to 'module')
| -rw-r--r-- | module/plugins/accounts/ShareRapidCom.py | 6 | ||||
| -rw-r--r-- | module/plugins/crypter/C1neonCom.py | 124 | ||||
| -rw-r--r-- | module/plugins/hoster/BayfilesCom.py | 2 | 
3 files changed, 128 insertions, 4 deletions
| diff --git a/module/plugins/accounts/ShareRapidCom.py b/module/plugins/accounts/ShareRapidCom.py index 9828b1f7e..a14f93a9c 100644 --- a/module/plugins/accounts/ShareRapidCom.py +++ b/module/plugins/accounts/ShareRapidCom.py @@ -5,7 +5,7 @@ from module.plugins.Account import Account  class ShareRapidCom(Account):      __name__ = "ShareRapidCom" -    __version__ = "0.1" +    __version__ = "0.2"      __type__ = "account"      __description__ = """ShareRapid account plugin"""      __author_name__ = ("MikyWoW") @@ -29,8 +29,8 @@ class ShareRapidCom(Account):               start = htm.index('id="inp_hash" name="hash" value="')               htm = htm[start+33:]               hashes = htm[0:32] -             html = req.load("http://share-rapid.com/prihlaseni/", +             htm = req.load("http://share-rapid.com/prihlaseni/",                  post={"hash": hashes,"login": user, "pass1": data["password"],"remember": 0,                        "sbmt": "P%C5%99ihl%C3%A1sit"}, cookies=True) -        if "Heslo:" in html: +        if "Heslo:" in htm:              self.wrongPassword()
\ No newline at end of file diff --git a/module/plugins/crypter/C1neonCom.py b/module/plugins/crypter/C1neonCom.py new file mode 100644 index 000000000..27ecb86d7 --- /dev/null +++ b/module/plugins/crypter/C1neonCom.py @@ -0,0 +1,124 @@ +# -*- coding: utf-8 -*- +""" +    This program is free software; you can redistribute it and/or modify +    it under the terms of the GNU General Public License as published by +    the Free Software Foundation; either version 3 of the License, +    or (at your option) any later version. + +    This program is distributed in the hope that it will be useful, +    but WITHOUT ANY WARRANTY; without even the implied warranty of +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +    See the GNU General Public License for more details. + +    You should have received a copy of the GNU General Public License +    along with this program; if not, see <http://www.gnu.org/licenses/>. + +    @author: godofdream +""" + +import re +from module.plugins.Crypter import Crypter +from module.common.json_layer import json_loads +class C1neonCom(Crypter): +    __name__ = "C1neonCom" +    __type__ = "container" +    __pattern__ = r"http://(www\.)?c1neon.com/.*?" +    __version__ = "0.01" +    __config__ = [ +        ("changeNameS", "Packagename;Show;Season;Episode", "Rename Show by", "Show"), +        ("changeName", "Packagename;Movie", "Rename Movie by", "Movie"), +        ("useStreams", "bool", "Use Streams too", False), +        ("hosterListMode", "all;onlypreferred", "Use for hosters (if supported)", "all"), +        ("hosterList", "str", "Preferred Hoster list (comma separated, no ending)", "2shared,Bayfiles,Netload,Rapidshare,Share-online"), +        ("ignoreList", "str", "Ignored Hoster list (comma separated, no ending)", "Megaupload") +        ] +    __description__ = """C1neon.Com Container Plugin""" +    __author_name__ = ("godofdream") +    __author_mail__ = ("soilfiction@gmail.com") + +    VALUES_PATTERN = r"var subcats = (.*?)(;</script>|;var)" +    SHOW_PATTERN = r"title='(.*?)'" +    SERIE_PATTERN = r"<title>.*Serie.*</title>" +     +    def decrypt(self, pyfile): +        src = self.req.load(str(pyfile.url)) + +        pattern = re.compile(self.VALUES_PATTERN, re.DOTALL) +        data = json_loads(re.search(pattern, src).group(1)) +         +        # Get package info  +        links = [] +        Showname = re.search(self.SHOW_PATTERN, src) +        if Showname: +            Showname = Showname.group(1).decode("utf-8") +        else: +            Showname = self.pyfile.package().name +             +        if re.search(self.SERIE_PATTERN, src): +            for Season in data: +                self.logDebug("Season " + Season) +                for Episode in data[Season]: +                    self.logDebug("Episode " + Episode) +                    links.extend(self.getpreferred(data[Season][Episode])) +                    if self.getConfig("changeNameS") == "Episode": +                        self.packages.append((data[Season][Episode]['info']['name'].split("»")[0], links, data[Season][Episode]['info']['name'].split("»")[0])) +                        links = [] +                     +                if self.getConfig("changeNameS") == "Season":   +                    self.packages.append((Showname + " Season " + Season, links, Showname + " Season " + Season)) +                    links = [] + +            if self.getConfig("changeNameS") == "Show": +                if  links == []: +                    self.fail('Could not extract any links (Out of Date?)') +                else: +                    self.packages.append((Showname, links, Showname)) +         +            elif self.getConfig("changeNameS") == "Packagename": +                if  links == []: +                    self.fail('Could not extract any links (Out of Date?)') +                else: +                    self.core.files.addLinks(links, self.pyfile.package().id) +        else: +            for Movie in data: +                links.extend(self.getpreferred(data[Movie])) +                if self.getConfig("changeName") == "Movie": +                    if  links == []: +                        self.fail('Could not extract any links (Out of Date?)') +                    else: +                        self.packages.append((Showname, links, Showname)) +             +                elif self.getConfig("changeName") == "Packagename": +                    if  links == []: +                        self.fail('Could not extract any links (Out of Date?)') +                    else: +                        self.core.files.addLinks(links, self.pyfile.package().id) + +    #selects the preferred hoster, after that selects any hoster (ignoring the one to ignore) +    #selects only one Hoster +    def getpreferred(self, hosterslist): +        hosterlist = hosterslist['d'] +        if self.getConfig("useStreams"): +            hosterlist.append(hosterslist['s']) +         +        result = [] +        for preferred in self.getConfig("hosterList").strip().lower().replace('|',',').replace('.','').replace(';',',').split(','): +            for Hoster in hosterlist: +                if preferred == Hoster.split('<')[0].strip().lower().replace('.',''): +                    for Part in hosterlist[Hoster]: +                        self.logDebug("selected " + Part[3]) +                        result.append(str(Part[3])) +                    return result + +        ignorelist = self.getConfig("ignoreList").strip().lower().replace('|',',').replace('.','').replace(';',',').split(',') +        if self.getConfig('hosterListMode') == "all": +            for Hoster in hosterlist: +                if Hoster.split('<')[0].strip().lower().replace('.','') not in ignorelist: +                    for Part in hosterlist[Hoster]: +                        self.logDebug("selected " + Part[3]) +                        result.append(str(Part[3])) +                    return result +        return result +         +         +       diff --git a/module/plugins/hoster/BayfilesCom.py b/module/plugins/hoster/BayfilesCom.py index a69dd3ea9..a6211ed1b 100644 --- a/module/plugins/hoster/BayfilesCom.py +++ b/module/plugins/hoster/BayfilesCom.py @@ -26,7 +26,7 @@ class BayfilesCom(SimpleHoster):      __name__ = "BayfilesCom"      __type__ = "hoster"      __pattern__ = r"http://(?:www\.)?bayfiles\.com/file/\w+/\w+/.*" -    __version__ = "0.02" +    __version__ = "0.03"      __description__ = """Bayfiles.com plugin - free only"""      __author_name__ = ("zoidberg")      __author_mail__ = ("zoidberg@mujmail.cz") | 
