Esempio n. 1
0
    def search(cls, actress, up_to, with_profile=False):
        lang = cls.__guess_lang(actress)

        if lang == "en":
            actress = ActressTranslate.translate2jp(actress)
        if actress:
            videos = [
                submit(source.search_by_actress, actress, up_to)
                for source in Sources.SearchByActress
            ]
            if with_profile:
                profile = submit(ActressInfo.get_actress_info, actress)
                names = submit(HistoryNames.get_history_names, actress)
                names = names.result()
                profile = profile.result()
                print(profile)
                if profile is None:
                    profile = Actress()
                    profile.other["history_names"] = names
                else:
                    profile.other["history_names"] = list(
                        set(names).union(set(profile.other["history_names"]))
                    )
                return wait_until(videos), profile
            else:
                return wait_until(videos), None

        return [], None
Esempio n. 2
0
    def search_by_actress(cls, actress, up_to, history_name=False):
        lang = cls.guess_lang(actress)

        if lang == "en":
            actress = ActressTranslate.translate2jp(actress)
        if actress:
            res = spawn(
                cls.sources_by_actress["indexav.com"].search_by_actress,
                actress, up_to)
            if history_name:
                names = spawn(HistoryNames.get_history_names, actress)
                return res.wait_for_result(), names.wait_for_result()
            else:
                return res.wait_for_result(), None
Esempio n. 3
0
    def search(cls, actress, up_to, history_name=False):
        lang = cls.__guess_lang(actress)

        if lang == "en":
            actress = ActressTranslate.translate2jp(actress)
        if actress:
            videos = [
                submit(source.search_by_actress, actress, up_to)
                for source in Sources.SearchByActress
            ]
            if history_name:
                names = submit(HistoryNames.get_history_names, actress)
                return wait_until(videos), names.result()
            else:
                return wait_until(videos), None
Esempio n. 4
0
    def search(cls, actress, up_to, history_name=False):
        lang = cls.__guess_lang(actress)

        if lang == "en":
            actress = ActressTranslate.translate2jp(actress)
        if actress:
            movies = spawn_many(
                Task(source.search_by_actress, actress, up_to)
                for source in Sources.SearchByActress)
            if history_name:
                names = spawn(HistoryNames.get_history_names, actress)
                result = movies.wait_for_one_finished(), names.wait_for_result(
                )
            else:
                result = movies.wait_for_one_finished(), None

            return result[0][0], result[1]
        else:
            return [], None