#: Get crypted
        strlist = list(params[2].decode('base64'))
        crypted = "".join(strlist[::-1])

        #: Log and return
        return crypted, jk


    def _get_links(self, crypted, jk):
        #: Get key
        jreturn = self.js.eval("%s f()" % jk)
        self.log_debug("JsEngine returns value [%s]" % jreturn)
        key = binascii.unhexlify(jreturn)

        #: Decrypt
        Key = key
        IV = key
        obj = AES.new(Key, AES.MODE_CBC, IV)
        text = obj.decrypt(crypted.decode('base64'))

        #: Extract links
        text = text.replace("\x00", "").replace("\r", "")
        links = filter(bool, text.split('\n'))

        #: Log and return
        self.log_debug("Block has %d links" % len(links))
        return links


getInfo = create_getInfo(ShareLinksBiz)
    FOLDER_PATTERN = r'<ul class="profile_files">(.*?)</ul>'
    LINK_PATTERN = r'<br /><a href="/(.+?)">.+?</a>'
    NEXT_PAGE_PATTERN = r'<a class="next " href="/(.+?)">&nbsp;</a>'


    def decrypt(self, pyfile):
        html = self.load(pyfile.url)

        new_links = []
        for i in xrange(1, 100):
            self.log_info(_("Fetching links from page %i") % i)
            m = re.search(self.FOLDER_PATTERN, html, re.S)
            if m is None:
                self.error(_("FOLDER_PATTERN not found"))

            new_links.extend(re.findall(self.LINK_PATTERN, m.group(1)))
            m = re.search(self.NEXT_PAGE_PATTERN, html)
            if m is not None:
                html = self.load("http://ulozto.net/" + m.group(1))
            else:
                break
        else:
            self.log_info(_("Limit of 99 pages reached, aborting"))

        if new_links:
            self.links = [map(lambda s: "http://ulozto.net/%s" % s, new_links)]


getInfo = create_getInfo(UlozToFolder)
Esempio n. 3
0
# -*- coding: utf-8 -*-

from module.plugins.internal.Crypter import Crypter, create_getInfo


class DeadCrypter(Crypter):
    __name__    = "DeadCrypter"
    __type__    = "crypter"
    __version__ = "0.09"
    __status__  = "testing"

    __pattern__ = r'^unmatchable$'

    __description__ = """Crypter is no longer available"""
    __license__     = "GPLv3"
    __authors__     = [("stickell", "*****@*****.**")]


    @classmethod
    def get_info(cls, *args, **kwargs):
        info = super(DeadCrypter, cls).get_info(*args, **kwargs)
        info['status'] = 1
        return info


    def setup(self):
        self.offline(_("Crypter is no longer available"))


getInfo = create_getInfo(DeadCrypter)
Esempio n. 4
0
    __name__    = "ChipDe"
    __type__    = "crypter"
    __version__ = "0.14"
    __status__  = "testing"

    __pattern__ = r'http://(?:www\.)?chip\.de/video/.+\.html'
    __config__  = [("activated"            , "bool", "Activated"                          , True),
                   ("use_premium"          , "bool", "Use premium account if available"   , True),
                   ("use_subfolder"        , "bool", "Save package to subfolder"          , True),
                   ("subfolder_per_package", "bool", "Create a subfolder for each package", True)]

    __description__ = """Chip.de decrypter plugin"""
    __license__     = "GPLv3"
    __authors__     = [("4Christopher", "*****@*****.**")]


    def decrypt(self, pyfile):
        self.data = self.load(pyfile.url)
        try:
            f = re.search(r'"(http://video\.chip\.de/.+)"', self.data)

        except Exception:
            self.fail(_("Failed to find the URL"))

        else:
            self.links = [f.group(1)]
            self.log_debug("The file URL is %s" % self.links[0])


getInfo = create_getInfo(ChipDe)
    def handle_CNL(self):
        try:
            vjk = re.findall('<input type="hidden" name="jk" value="function f\(\){ return \'(.*)\';}">', self.site_with_links)
            vcrypted = re.findall('<input type="hidden" name="crypted" value="(.*)">', self.site_with_links)

            for i in xrange(len(vcrypted)):
                self.urls.extend(self._get_links(vcrypted[i], vjk[i]))

        except Exception, e:
            self.log_debug("Error decrypting CNL: %s" % e)


    def _get_links(self, crypted, jk):
        #: Get key
        key = binascii.unhexlify(str(jk))

        #: Decrypt
        Key  = key
        IV   = key
        obj  = AES.new(Key, AES.MODE_CBC, IV)
        text = obj.decrypt(crypted.decode('base64'))

        #: Extract links
        text  = text.replace("\x00", "").replace("\r", "")
        links = filter(bool, text.split('\n'))

        return links


getInfo = create_getInfo(FilecryptCc)
            prefered_set = map(lambda s: s.lower().split('.')[0], prefered_set)

            self.log_debug("PF: %s" % prefered_set)

            tmp_links.extend(x[1] for x in m if x[0] in prefered_set)
            self.links = self.get_location(tmp_links)

            if not self.links:
                ignored_set = set(self.get_config('ignoredHoster').split('|'))
                ignored_set = map(lambda s: s.lower().split('.')[0], ignored_set)

                self.log_debug("IG: %s" % ignored_set)

                tmp_links.extend(x[1] for x in m if x[0] not in ignored_set)
                self.links = self.get_location(tmp_links)


    def get_location(self, tmp_links):
        new_links = []
        for link in tmp_links:
            try:
                header = self.load(link, just_header=True)
                if 'location' in header:
                    new_links.append(header.get('location'))
            except BadHeader:
                pass
        return new_links


getInfo = create_getInfo(EmbeduploadCom)
            abookname = soup.find("a", attrs={'rel': "bookmark"}).text
            for a in soup.findAll("a", attrs={'href': self.protection}):
                package = "%s (%s)" % (abookname, a.previousSibling.previousSibling.text[:-1])
                links = self.decrypt_folder(a['href'])

                self.packages.append((package, links, package))
        else:
            self.links = self.decrypt_folder(pyfile.url)


    def decrypt_folder(self, url):
        m = self.protection.search(url)
        if m is None:
            self.fail(_("Bad URL"))
        url = m.group(0)

        self.pyfile.url = url
        html = self.load(url, post={'viewed': "adpg"})

        links = []
        pattern = re.compile("http://www\.hoerbuch\.in/protection/(\w+)/(.*?)\"")
        for hoster, lid in pattern.findall(html):
            self.req.lastURL = url
            self.load("http://www.hoerbuch.in/protection/%s/%s" % (hoster, lid))
            links.append(self.req.lastEffectiveURL)

        return links


getInfo = create_getInfo(HoerbuchIn)
Esempio n. 8
0
    __authors__     = [("Frederik Möllers", "*****@*****.**")]


    NAME_PATTERN = r'<title>(?P<N>.+?) - .+</title>'
    NAME_PATTERN = r"'save_paste' href=\"(http://pasted.co/[0-9a-f]+)/info"

    FS_URL_PREFIX = '<pre id=\'thepaste\' class="prettyprint">'
    FS_URL_SUFFIX = '</pre>'

    def decrypt(self, pyfile):
        package = pyfile.package()
        package_name = package.name
        package_folder = package.folder
        html = self.load(pyfile.url, decode = True).splitlines()
        fs_url = None
        FS_URL_RE = re.compile('%s/fullscreen\.php\?hash=[0-9a-f]*' % pyfile.url)
        for line in html:
            match = FS_URL_RE.search(line)
            if match:
                fs_url = match.group()
                break
        if not fs_url:
            raise Exception("Could not find pasted.co fullscreen URL!")
        urls = self.load(fs_url, decode = True)
        urls = urls[urls.find(PastedCo.FS_URL_PREFIX) + len(PastedCo.FS_URL_PREFIX):]
        urls = urls[:urls.find(PastedCo.FS_URL_SUFFIX)].splitlines()
        self.packages.append((package_name, urls, package_folder))


getInfo = create_getInfo(PastedCo)
Esempio n. 9
0
from module.plugins.internal.Crypter import Crypter, create_getInfo


class XupPl(Crypter):
    __name__    = "XupPl"
    __type__    = "crypter"
    __version__ = "0.14"
    __status__  = "testing"

    __pattern__ = r'https?://(?:[^/]*\.)?xup\.pl/.+'
    __config__  = [("activated"            , "bool", "Activated"                          , True),
                   ("use_premium"          , "bool", "Use premium account if available"   , True),
                   ("use_subfolder"        , "bool", "Save package to subfolder"          , True),
                   ("subfolder_per_package", "bool", "Create a subfolder for each package", True)]

    __description__ = """Xup.pl decrypter plugin"""
    __license__     = "GPLv3"
    __authors__     = [("z00nx", "*****@*****.**")]


    def decrypt(self, pyfile):
        header = self.load(pyfile.url, just_header=True)
        if 'location' in header:
            self.links = [header.get('location')]
        else:
            self.fail(_("Unable to find link"))


getInfo = create_getInfo(XupPl)
    __config__  = [("activated"            , "bool", "Activated"                          , True),
                   ("use_premium"          , "bool", "Use premium account if available"   , True),
                   ("use_subfolder"        , "bool", "Save package to subfolder"          , True),
                   ("subfolder_per_package", "bool", "Create a subfolder for each package", True)]

    __description__ = """FileServe.com folder decrypter plugin"""
    __license__     = "GPLv3"
    __authors__     = [("fionnc", "*****@*****.**")]


    FOLDER_PATTERN = r'<table class="file_list">(.*?)</table>'
    LINK_PATTERN = r'<a href="(.+?)" class="sheet_icon wbold">'


    def decrypt(self, pyfile):
        html = self.load(pyfile.url)

        new_links = []

        folder = re.search(self.FOLDER_PATTERN, html, re.S)
        if folder is None:
            self.error(_("FOLDER_PATTERN not found"))

        new_links.extend(re.findall(self.LINK_PATTERN, folder.group(1)))

        if new_links:
            self.links = [map(lambda s: "http://fileserve.com%s" % s, new_links)]


getInfo = create_getInfo(FileserveComFolder)

class MegaCoNzFolder(Crypter):
    __name__    = "MegaCoNzFolder"
    __type__    = "crypter"
    __version__ = "0.09"
    __status__  = "broken"

    __pattern__ = r'(https?://(?:www\.)?mega(\.co)?\.nz/|mega:|chrome:.+?)#F!(?P<ID>[\w^_]+)!(?P<KEY>[\w,\\-]+)'
    __config__  = [("activated"            , "bool", "Activated"                          , True),
                   ("use_premium"          , "bool", "Use premium account if available"   , True),
                   ("use_subfolder"        , "bool", "Save package to subfolder"          , True),
                   ("subfolder_per_package", "bool", "Create a subfolder for each package", True)]

    __description__ = """Mega.co.nz folder decrypter plugin"""
    __license__     = "GPLv3"
    __authors__     = [("Walter Purcaro", "*****@*****.**")]


    def setup(self):
        self.req.setOption("timeout", 300)


    def decrypt(self, pyfile):
        url       = "https://mega.co.nz/#F!%s!%s" % re.match(self.__pattern__, pyfile.url).groups()
        self.data = self.load("http://rapidgen.org/linkfinder", post={'linklisturl': url})
        self.links = re.findall(r'(https://mega(\.co)?\.nz/#N!.+?)<', self.data)


getInfo = create_getInfo(MegaCoNzFolder)

    def get_videos(self, playlist_id):
        return list(self._get_videos(playlist_id))[::-1]


    def decrypt(self, pyfile):
        m_id   = self.info['pattern']['ID']
        m_type = self.info['pattern']['TYPE']

        if m_type == "playlist":
            self.log_debug("Url recognized as Playlist")
            p_info = self.get_playlist_info(m_id)
            playlists = [(m_id,) + p_info] if p_info else None
        else:
            self.log_debug("Url recognized as Channel")
            playlists = self.get_playlists(m_id)
            self.log_debug("%s playlist\s found on channel \"%s\"" % (len(playlists), m_id))

        if not playlists:
            self.fail(_("No playlist available"))

        for p_id, p_name, p_owner in playlists:
            p_videos = self.get_videos(p_id)
            p_folder = fs_join(self.pyload.config.get("general", "download_folder"), p_owner, p_name)
            self.log_debug("%s video\s found on playlist \"%s\"" % (len(p_videos), p_name))
            self.packages.append((p_name, p_videos, p_folder))  #@NOTE: Folder is NOT recognized by pyload 0.4.9!


getInfo = create_getInfo(DailymotionComFolder)
Esempio n. 13
0
        crypted_re = pattern % NCryptIn.CRYPTED_KEY
        vcrypted = re.findall(crypted_re, self.data)

        #: Log and return
        self.log_debug("Detected %d crypted blocks" % len(vcrypted))
        return vcrypted, vjk


    def _get_links(self, crypted, jk):
        #: Get key
        jreturn = self.js.eval("%s f()" % jk)
        self.log_debug("JsEngine returns value [%s]" % jreturn)
        key = binascii.unhexlify(jreturn)

        #: Decrypt
        Key = key
        IV = key
        obj = AES.new(Key, AES.MODE_CBC, IV)
        text = obj.decrypt(crypted.decode('base64'))

        #: Extract links
        text = text.replace("\x00", "").replace("\r", "")
        links = filter(bool, text.split('\n'))

        #: Log and return
        self.log_debug("Block has %d links" % len(links))
        return links


getInfo = create_getInfo(NCryptIn)
    __version__ = "0.15"
    __status__  = "testing"

    __pattern__ = r'http://(?:www\.)?letitbit\.net/folder/\w+'
    __config__  = [("activated"            , "bool", "Activated"                          , True),
                   ("use_premium"          , "bool", "Use premium account if available"   , True),
                   ("use_subfolder"        , "bool", "Save package to subfolder"          , True),
                   ("subfolder_per_package", "bool", "Create a subfolder for each package", True)]

    __description__ = """Letitbit.net folder decrypter plugin"""
    __license__     = "GPLv3"
    __authors__     = [("DHMH", "*****@*****.**"),
                       ("z00nx", "*****@*****.**")]


    FOLDER_PATTERN = r'<table>(.*)</table>'
    LINK_PATTERN = r'<a href="(.+?)" target="_blank">'


    def decrypt(self, pyfile):
        html = self.load(pyfile.url)

        folder = re.search(self.FOLDER_PATTERN, html, re.S)
        if folder is None:
            self.error(_("FOLDER_PATTERN not found"))

        self.links.extend(re.findall(self.LINK_PATTERN, folder.group(0)))


getInfo = create_getInfo(LetitbitNetFolder)
Esempio n. 15
0
                if pwd and not (pwd in self.LIST_PWDIGNORE):
                    password = pwd
                    self.log_debug("Package info found, password [%s]" % password)

            #: Process links (dl_link)
            html = self.load(url)
            links = re.findall(self.PATTERN_REDIRECT_LINKS, html, re.I)
            if not links:
                self.log_error(_("Broken for link: %s") % link)
            else:
                for link in links:
                    link = link.replace("http://sexuria.com/", "http://www.sexuria.com/")
                    finallink = self.load(link, just_header=True)["location"]
                    if not finallink or ("sexuria.com/" in finallink):
                        self.log_error(_("Broken for link: %s") % link)
                    else:
                        linklist.append(finallink)

        #: Log result
        if not linklist:
            self.fail(_("Unable to extract links (maybe plugin out of date?)"))
        else:
            for i, link in enumerate(linklist):
                self.log_debug("Supported link %d/%d: %s" % (i + 1, len(linklist), link))

        #: All done, return to caller
        return name, linklist, folder, password


getInfo = create_getInfo(SexuriaCom)
        #: Log and return
        self.log_debug("Detected %d crypted blocks" % len(vcrypted))
        return vcrypted, vjk


    def _get_links(self, crypted, jk):
        #: Get key
        jreturn = self.js.eval("%s f()" % jk)
        key     = binascii.unhexlify(jreturn)

        self.log_debug("JsEngine returns value [%s]" % jreturn)

        #: Decrypt
        Key  = key
        IV   = key
        obj  = AES.new(Key, AES.MODE_CBC, IV)
        text = obj.decrypt(crypted.decode('base64'))

        #: Extract links
        text  = text.replace("\x00", "").replace("\r", "")
        links = filter(bool, text.split('\n'))

        #: Log and return
        self.log_debug("Package has %d links" % len(links))

        return links


getInfo = create_getInfo(LinkCryptWs)
                   ("ignoredHoster"        , "str" , "Ignored hoster list (bar-separated)" , ""  )]

    __description__ = """Multiload.cz decrypter plugin"""
    __license__     = "GPLv3"
    __authors__     = [("zoidberg", "*****@*****.**")]


    FOLDER_PATTERN = r'<form action="" method="get"><textarea.*?>([^>]*)</textarea></form>'
    LINK_PATTERN = r'<p class="manager-server"><strong>([^<]+)</strong></p><p class="manager-linky"><a href="(.+?)">'


    def decrypt(self, pyfile):
        self.data = self.load(pyfile.url)

        if re.match(self.__pattern__, pyfile.url).group(1) == "slozka":
            m = re.search(self.FOLDER_PATTERN, self.data)
            if m is not None:
                self.links.extend(m.group(1).split())
        else:
            m = re.findall(self.LINK_PATTERN, self.data)
            if m is not None:
                prefered_set = set(self.get_config('usedHoster').split('|'))
                self.links.extend(x[1] for x in m if x[0] in prefered_set)

                if not self.links:
                    ignored_set = set(self.get_config('ignoredHoster').split('|'))
                    self.links.extend(x[1] for x in m if x[0] not in ignored_set)


getInfo = create_getInfo(MultiloadCz)
Esempio n. 18
0
        id = m.group('ID')
        self.log_debug("File id is %s" % id)

        self.data = self.load(url)

        m = re.search(self.SUBMIT_PATTERN, self.data)
        if m is None:
            self.error(_("Link doesn't seem valid"))

        m = re.search(self.CAPTCHA_PATTERN, self.data)
        if m is not None:
            captcharesult = self.captcha.decrypt(urlparse.urljoin("http://lix.in/", m.group(1)))
            self.data = self.load(url, post={'capt': captcharesult, 'submit': "submit", 'tiny': id})

            if re.search(self.CAPTCHA_PATTERN, self.data):
                self.fail(_("No captcha solved"))

        else:
            self.data = self.load(url, post={'submit': "submit", 'tiny': id})

        m = re.search(self.LINK_PATTERN, self.data)
        if m is None:
            self.error(_("Unable to find destination url"))
        else:
            self.links = [m.group(1)]
            self.log_debug("Found link %s, adding to package" % self.links[0])


getInfo = create_getInfo(LixIn)
Esempio n. 19
0
from module.plugins.internal.Crypter import Crypter, create_getInfo


class ShSt(Crypter):
    __name__    = "ShSt"
    __type__    = "crypter"
    __version__ = "0.07"
    __status__  = "testing"

    __pattern__ = r'http://sh\.st/\w+'
    __config__  = [("activated", "bool", "Activated", True)]

    __description__ = """Sh.St decrypter plugin"""
    __license__     = "GPLv3"
    __authors__     = [("Frederik Möllers", "*****@*****.**")]


    NAME_PATTERN = r'<title>(?P<N>.+?) -'


    def decrypt(self, pyfile):
        #: If we use curl as a user agent, we will get a straight redirect (no waiting!)
        self.req.http.c.setopt(pycurl.USERAGENT, "curl/7.42.1")
        #: Fetch the target URL
        header = self.load(self.pyfile.url, just_header = True, decode = False)
        target_url = header.get('location')
        self.links.append(target_url)


getInfo = create_getInfo(ShSt)
                playlists = []
        else:
            self.log_debug("Url recognized as Playlist")
            playlists = [self.get_playlist(m_id)]

        if not playlists:
            self.fail(_("No playlist available"))

        addedvideos = []
        urlize = lambda x: "https://www.youtube.com/watch?v=" + x
        for p in playlists:
            p_name = p['title']
            p_videos = self.get_videos_id(p['id'])
            p_folder = fs_join(self.pyload.config.get("general", "download_folder"), p['channelTitle'], p_name)
            self.log_debug("%s video\s found on playlist \"%s\"" % (len(p_videos), p_name))

            if not p_videos:
                continue
            elif "checkDups" in p:
                p_urls = [urlize(v_id) for v_id in p_videos if v_id not in addedvideos]
                self.log_debug("%s video\s available on playlist \"%s\" after duplicates cleanup" % (len(p_urls), p_name))
            else:
                p_urls = map(urlize, p_videos)

            self.packages.append((p_name, p_urls, p_folder))  #: Folder is NOT recognized by pyload 0.4.9!

            addedvideos.extend(p_videos)


getInfo = create_getInfo(YoutubeComFolder)
    __type__ = "crypter"
    __version__ = "0.25"
    __status__ = "testing"

    __pattern__ = r"http://(?:www\.)?(czshare|sdilej)\.(com|cz)/folders/.+"
    __config__ = [
        ("activated", "bool", "Activated", True),
        ("use_premium", "bool", "Use premium account if available", True),
        ("use_subfolder", "bool", "Save package to subfolder", True),
        ("subfolder_per_package", "bool", "Create a subfolder for each package", True),
    ]

    __description__ = """Czshare.com folder decrypter plugin, now Sdilej.cz"""
    __license__ = "GPLv3"
    __authors__ = [("zoidberg", "*****@*****.**")]

    FOLDER_PATTERN = r'<tr class="subdirectory">\s*<td>\s*<table>(.*?)</table>'
    LINK_PATTERN = r'<td class="col2"><a href="(.+?)">info</a></td>'

    def decrypt(self, pyfile):
        html = self.load(pyfile.url)

        m = re.search(self.FOLDER_PATTERN, html, re.S)
        if m is None:
            self.error(_("FOLDER_PATTERN not found"))

        self.links.extend(re.findall(self.LINK_PATTERN, m.group(1)))


getInfo = create_getInfo(CzshareComFolder)