def search_mirrors(film_to_see): try: json = new_way(film_to_see) return json except: pass domain = get_domain(film_to_see) body = get(film_to_see, headers = headers).text parsing = BeautifulSoup(body, "html.parser") mirrors = parsing.find("ul", id = "mirrors") json = { "results": [] } datas = json['results'] for a in mirrors.find_all("li"): c = a.find("a") if not c: continue mirror = recognize_mirror( c.get_text() ) try: hosts[mirror] quality = "720p" link_mirror = recognize_link( c.get("data-target") ) data = { "mirror": mirror, "quality": quality, "link": link_mirror, "domain": domain } datas.append(data) except KeyError: pass return json
def search_mirrors(film_to_see): try: json = new_way(film_to_see) return json except: pass domain = get_domain(film_to_see) body = get(film_to_see, headers = headers).text parsing = BeautifulSoup(body, "html.parser") mirrors = parsing.find_all("ul", class_ = "host")[1] json = { "results": [] } datas = json['results'] for a in mirrors.find_all("a"): mirror = recognize_mirror( a .find("span", class_ = "b") .get_text()[1:] .split(" ")[0] ) try: hosts[mirror] quality = a.find("span", class_ = "d").get_text() link_mirror = recognize_link( a.get("data-link") ) data = { "mirror": mirror, "quality": quality, "link": link_mirror, "domain": domain } datas.append(data) except KeyError: pass return json
def search_mirrors(film_to_see): try: json = new_way(film_to_see) return json except: pass domain = get_domain(film_to_see) body = get(film_to_see, headers=headers).text parsing = BeautifulSoup(body, "html.parser") parsing = parsing.find("div", class_="col-xs-6 col-md-4") array = parsing.find_all("a") del array[0] json = {"results": []} datas = json['results'] for a in array: link_enc = (a.get("href").split("link=")[1].split("&")[0]) link_mirror = recognize_link(decode_middle_encrypted(link_enc)) mirror = recognize_mirror(a.get_text().lower()) quality = "720p" try: hosts[mirror] data = { "mirror": mirror, "quality": quality, "link": link_mirror, "domain": domain } datas.append(data) except KeyError: pass return json