Пример #1
0
 def get_history_names(actress):
     result = list(
         filter(
             lambda x: x,
             wait_for_all([submit(src.get_history_names, actress)
                           for src in Sources.HistoryNames])
         )
     )
     if len(result) == 0:
         return []
     if len(result) == 1:
         return result[0]
     else:
         return list(reduce(lambda x, y: x.union(y), map(lambda z: set(z), result)))
Пример #2
0
 def search_by_actress(mcs, actress, up_to):
     url = "https://indexav.com/actor/" + actress
     rsp = requests.get(url, verify=False, proxies=proxy)
     bs = bs4.BeautifulSoup(rsp.text, "lxml")
     ul = bs.select(".pagination-list")
     if len(ul) == 0:
         return mcs.__search_by_actress_in_page(actress, 1)
     else:
         return reduce(
             lambda x1, x2: x1 + x2,
             filter(
                 lambda x: x,
                 wait_for_all(
                     [
                         submit(
                             mcs.__search_by_actress_in_page,
                             actress,
                             int(page.text.strip()),
                         )
                         for page in ul[0].find_all("li")
                     ]
                 ),
             ),
         )
Пример #3
0
 def get_brief(code):
     return conclude(
         wait_for_all(
             [submit(source.get_brief, code) for source in Sources.Brief]))