コード例 #1
0
    def generate_packages(self, links):
        """
        Parses links, generates packages names from urls

        :param links: list of urls
        :return: package names mapped to urls
        """
        result = parse.packs((x, x) for x in links)
        return result
コード例 #2
0
ファイル: predownload.py プロジェクト: GammaC0de/pyload
    def generate_packages(self, links):
        """Parses links, generates packages names from urls.

        :param links: list of urls
        :return: package names mapped to urls

        """
        result = parse.packs((x, x) for x in links)
        return result
コード例 #3
0
    def update_result(self, result):
        tmp = {}
        res = []
        # separate these with name and without
        for link in result:
            if link.url in self.names:
                tmp[link] = self.names[link.url]
            else:
                res.append(link)

        data = parse.packs((link.name, link) for link in res)
        # merge in packages that already have a name
        data = accumulate(tmp.items(), data)

        # TODO: self.oc is None ?!
        self.manager.set_info_results(self.oc, data)
コード例 #4
0
ファイル: info.py プロジェクト: GammaC0de/pyload
    def update_result(self, result):
        tmp = {}
        res = []
        # separate these with name and without
        for link in result:
            if link.url in self.names:
                tmp[link] = self.names[link.url]
            else:
                res.append(link)

        data = parse.packs((link.name, link) for link in res)
        # merge in packages that already have a name
        data = accumulate(tmp.items(), data)

        # TODO: self.oc is None ?!
        self.manager.set_info_results(self.oc, data)
コード例 #5
0
    def check_links(self, links):
        """
        Initiates online status check, will also decrypt files.

        :param links:
        :return: initial set of data as :class:`OnlineCheck` instance
        containing the result id
        """
        hoster, crypter = self.__pyload.pgm.parse_urls(links)

        # TODO: withhold crypter, derypt or add later
        # initial result does not contain the crypter links
        tmp = [(url, LinkStatus(url, url, -1, DownloadStatus.Queued,
                                pluginname)) for url, pluginname in hoster]
        data = parse.packs(tmp)
        rid = self.__pyload.iom.create_result_thread(hoster + crypter)

        return OnlineCheck(rid, data)
コード例 #6
0
ファイル: predownload.py プロジェクト: vuolter/pyload
    def check_links(self, links):
        """
        Initiates online status check, will also decrypt files.

        :param links:
        :return: initial set of data as :class:`OnlineCheck` instance containing the result id
        """
        hoster, crypter = self.pyload.pgm.parse_urls(links)

        # TODO: withhold crypter, derypt or add later
        # initial result does not contain the crypter links
        tmp = [(url, LinkStatus(url, url, -1, DownloadStatus.Queued, pluginname))
               for url, pluginname in hoster]
        data = parse.packs(tmp)
        rid = self.pyload.thm.create_result_thread(
            self.primary_uid, hoster + crypter)

        return OnlineCheck(rid, data)