(.*?)
') item.infoLabels['plot'] = plot if filtro_enlaces != 0: list_enlaces = bloque_enlaces(data, filtro_idioma, dict_idiomas, "online", item) if list_enlaces: itemlist.append(item.clone(action="", title="Enlaces Online", text_color=color1, text_bold=True)) itemlist.extend(list_enlaces) if filtro_enlaces != 1: list_enlaces = bloque_enlaces(data, filtro_idioma, dict_idiomas, "descarga", item) if list_enlaces: itemlist.append(item.clone(action="", title="Enlaces Descarga", text_color=color1, text_bold=True)) itemlist.extend(list_enlaces) if itemlist: itemlist.append(item.clone(channel="trailertools", title="Buscar Tráiler", action="buscartrailer", context="", text_color="magenta")) # Opción "Añadir esta película a la videoteca" if item.extra != "library": if config.get_videolibrary_support(): itemlist.append(Item(channel=item.channel, title="Añadir a la videoteca", text_color="green", action="add_pelicula_to_library", url=item.url, fulltitle = item.fulltitle )) else: itemlist.append(item.clone(title="No hay enlaces disponibles", action="", text_color=color3)) return itemlist def bloque_enlaces(data, filtro_idioma, dict_idiomas, type, item): logger.info() lista_enlaces = [] matches = [] if type == "online": t_tipo = "Ver Online" if type == "descarga": t_tipo = "Descargar" data = data.replace("\n", "") if type == "online": patron = '(?is)class="playex.*?sheader' bloque1 = scrapertools.find_single_match(data, patron) patron = '(?is)#(option-[^"]+).*?png">([^<]+)' match = scrapertools.find_multiple_matches(data, patron) for scrapedoption, language in match: scrapedserver = "" lazy = "" if "lazy" in bloque1: lazy = "lazy-" patron = '(?s)id="%s".*?metaframe.*?%ssrc="([^"]+)' % (scrapedoption, lazy) url = scrapertools.find_single_match(bloque1, patron) if "goo.gl" in url: url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location", "") if "player" in url: scrapedserver = scrapertools.find_single_match(url, 'player/(\w+)') if "ok" in scrapedserver: scrapedserver = "okru" matches.append([url, scrapedserver, "", language.strip(), t_tipo]) bloque2 = scrapertools.find_single_match(data, '(?s)box_links.*?dt_social_single') bloque2 = bloque2.replace("\t", "").replace("\r", "") patron = '(?s)optn" href="([^"]+)' patron += '.*?alt="([^\.]+)' patron += '.*?src.*?src="[^>]+"?/>([^<]+)' patron += '.*?src="[^>]+"?/>([^<]+)' patron += '.*?/span>([^<]+)' matches.extend(scrapertools.find_multiple_matches(bloque2, patron)) filtrados = [] for match in matches: scrapedurl = match[0] scrapedserver = match[1] scrapedcalidad = match[2] language = match[3] scrapedtipo = match[4] if t_tipo.upper() not in scrapedtipo.upper(): continue title = " Mirror en %s (" + language + ")" if len(scrapedcalidad.strip()) > 0: title += " (Calidad " + scrapedcalidad.strip() + ")" if filtro_idioma == 3 or item.filtro: lista_enlaces.append(item.clone(title=title, action="play", text_color=color2, url=scrapedurl, server=scrapedserver, extra=item.url, contentThumbnail = item.thumbnail, language=language)) else: idioma = dict_idiomas[language] if idioma == filtro_idioma: lista_enlaces.append(item.clone(title=title, action="play", text_color=color2, url=scrapedurl, server=scrapedserver, extra=item.url, contentThumbnail = item.thumbnail, language=language)) else: if language not in filtrados: filtrados.append(language) lista_enlaces = servertools.get_servers_itemlist(lista_enlaces, lambda i: i.title % i.server.capitalize()) if filtro_idioma != 3: if len(filtrados) > 0: title = "Mostrar también enlaces filtrados en %s" % ", ".join(filtrados) lista_enlaces.append(item.clone(title=title, action="findvideos", url=item.url, text_color=color3, filtro=True)) return lista_enlaces def play(item): logger.info() itemlist = [] if "api.cinetux" in item.url or item.server == "okru": data = httptools.downloadpage(item.url, headers={'Referer': item.extra}).data.replace("\\", "") id = scrapertools.find_single_match(data, 'img src="[^#]+#(.*?)"') item.url = "https://youtube.googleapis.com/embed/?status=ok&hl=es&allow_embed=1&ps=docs&partnerid=30&hd=1&autoplay=0&cc_load_policy=1&showinfo=0&docid=" + id if item.server == "okru": item.url = "https://ok.ru/videoembed/" + id elif "links" in item.url or "www.cinetux.me" in item.url: data = httptools.downloadpage(item.url).data scrapedurl = scrapertools.find_single_match(data, '