def search_results(item): logger.info() itemlist = list() soup = create_soup(item.url) for elem in soup.find_all("div", class_="result-item"): url = elem.a["href"] thumb = elem.img["src"] title = elem.img["alt"] year = elem.find("span", class_="year").text language = get_language(elem) new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumb, language=language, infoLabels={'year': year}) if "movies" in url: new_item.action = "findvideos" new_item.contentTitle = new_item.title else: new_item.action = "seasons" new_item.contentSerieName = new_item.title new_item.context = filtertools.context(item, list_language, list_quality) itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) try: url_next_page = soup.find_all("a", class_="arrow_pag")[-1]["href"] except: return itemlist itemlist.append( Item(channel=item.channel, title="Siguiente >>", url=url_next_page, action='search_results')) return itemlist
def list_all(item): logger.info() itemlist = [] data = get_source(item.url) json_data = jsontools.load(data) if len(json_data) > 0: for elem in json_data['pagination']['data']: year = elem['year'] lang = elem['language'] url = '%ssecure/titles/%s?titleId=%s' % (host, elem['id'], elem['id']) if elem['poster']: thumb = elem['poster'] else: thumb = '' new_item = Item(channel=item.channel, title=elem['name'], thumbnail=thumb, url=url, infoLabels={'year': year}) if 'movie' in item.url: new_item.contentTitle = elem['name'] new_item.action = 'findvideos' else: new_item.contentSerieName = elem['name'] new_item.action = 'seasons' itemlist.append(new_item) tmdb.set_infoLabels(itemlist, True) ## Pagination try: next_page = '%s%s' % (item.url, json_data['pagination']['next_page_url'].replace( '/?', '&')) itemlist.append( Item(channel=item.channel, action='list_all', url=next_page, title='Siguiente >>')) except: pass return itemlist
def list_all(item): logger.info() itemlist = list() soup = create_soup(item.url) matches = soup.find("ul", class_="list-movie").find_all("li", class_="item") for elem in matches: url = elem.a["href"] title = elem.h2.text year = scrapertools.find_single_match(elem.h4.text, "(\d{4})") thumb = elem.a.img["src"] new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumb, infoLabels={'year': year}) if "/serie" in url: new_item.contentSerieName = title new_item.action = "seasons" new_item.context = filtertools.context(item, list_language, list_quality) else: new_item.contentTitle = title new_item.action = "findvideos" itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) try: url_next_page = soup.find("a", class_="nextpostslink")["href"] if url_next_page: itemlist.append( Item(channel=item.channel, title="Siguiente >>", url=url_next_page, action='list_all', section=item.section)) except: pass return itemlist
def list_all(item): logger.info() itemlist = [] media_type = item.media_type json_data = load_json(item) if json_data: for media in json_data[media_type]: quality, language, plot, poster = set_extra_values(media) title = media['title'] title = set_title(title, language, quality) new_item = Item(channel=item.channel, title=format_title(title), quality=quality, language=language, plot=plot, personal_plot=plot, thumbnail=poster, path=item.path) new_item.infoLabels[ 'year'] = media['year'] if 'year' in media else '' new_item.infoLabels[ 'tmdb_id'] = media['tmdb_id'] if 'tmdb_id' in media else '' if 'movies_list' in json_data or 'generic_list' in json_data: new_item.url = media new_item.contentTitle = media['title'] new_item.action = 'findvideos' else: new_item.url = media['seasons_list'] new_item.contentSerieName = media['title'] new_item.action = 'seasons' itemlist.append(new_item) if not 'generic_list' in json_data: tmdb.set_infoLabels(itemlist, seekTmdb=True) for item in itemlist: if item.personal_plot != item.plot and item.personal_plot: item.plot = '\n\n' + typo( '', 'submenu') + '\n' + item.personal_plot + '\n' + typo( '', 'submenu') + '\n\n' + item.plot return itemlist
def listado(item): logger.info() itemlist = [] data = get_source(item.url) url_pagination = scrapertools.find_single_match( data, '<li class="active">.*?</li><li><a href="([^"]+)">') data = scrapertools.find_multiple_matches( data, '<ul class="ListAnimes[^>]+>(.*?)</ul>') data = "".join(data) matches = re.compile( '<a href="([^"]+)">.+?<img src="([^"]+)".+?<span class=.+?>(.*?)</span>.+?<h3.*?>(.*?)</h3>' '.*?</p><p>(.*?)</p>', re.DOTALL).findall(data) for url, thumbnail, _type, title, plot in matches: url = urlparse.urljoin(HOST, url) thumbnail = urlparse.urljoin(HOST, thumbnail) new_item = Item(channel=item.channel, action="episodios", title=title, url=url, thumbnail=thumbnail, plot=plot) if _type == "Anime": new_item.contentSerieName = title new_item.context = renumbertools.context(item) else: new_item.contentType = "movie" new_item.contentTitle = title itemlist.append(new_item) if url_pagination: url = urlparse.urljoin(HOST, url_pagination) title = ">> Pagina Siguiente" itemlist.append( Item(channel=item.channel, action="listado", title=title, url=url)) tmdb.set_infoLabels(itemlist, seekTmdb=True) return itemlist
def list_all(item): logger.info() itemlist = list() soup = create_soup(item.url) matches = soup.find("ul", class_="MovieList NoLmtxt Rows AX A06 B04 C03 E20") if not matches: return itemlist for elem in matches.find_all("article"): url = elem.a["href"] title = elem.a.h3.text thumb = elem.img if thumb.has_attr("data-lazy-src"): thumb = thumb["data-lazy-src"] else: thumb = thumb["src"] try: year = elem.find("span", class_="Year").text except: year = '-' new_item = Item(channel=item.channel, url=url, title=title, thumbnail=thumb, infoLabels={'year': year}) if elem.figcaption or elem.find("span", class_="TpTv BgA"): new_item.action = "seasons" new_item.contentSerieName = title else: new_item.action = "findvideos" new_item.contentTitle = title itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) next_page = soup.find("a", class_="next page-numbers")["href"] itemlist.append( Item(channel=item.channel, title="Siguiente >>", url=next_page, action='list_all')) return itemlist
def list_all(item): logger.info() itemlist = list() soup = create_soup(item.url) matches = soup.find_all("div", class_="main-peliculas")[-1].find_all( "div", class_="movie-box-1") for elem in matches: thumb = elem.a.figure.img["src"] title = elem.a.p.text url = elem.a["href"] year = elem.a.span.text new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumb, infoLabels={"year": year}) if "serie/" in url: new_item.contentSerieName = title new_item.action = "seasons" else: new_item.contentTitle = title new_item.action = "findvideos" itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) #try: url_next_page = soup.find("ul", class_="pagination").find_all("li")[-1].a["href"] #except: # return itemlist if url_next_page: itemlist.append( Item(channel=item.channel, title="Siguiente >>", url=url_next_page, action='list_all')) return itemlist
def list_all(item): logger.info() itemlist = list() soup = create_soup(item.url) matches = soup.find("div", class_="Posters") for elem in matches.find_all("a"): url = elem["href"] thumb = elem.img["src"] title = scrapertools.find_single_match(elem.p.text, r"(.*?) \(") year = scrapertools.find_single_match(elem.p.text, r"(\d{4})") if item.type and item.type.lower() not in url: continue new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumb, infoLabels={"year": year}) if "/pelicula/" in url: new_item.contentTitle = title new_item.action = "findvideos" else: new_item.contentSerieName = title new_item.action = "seasons" itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) # Paginación try: next_page = soup.find("a", class_="page-link", rel="next")["href"] if next_page: itemlist.append( Item(channel=item.channel, title="Siguiente >>", url=next_page, action='list_all')) except: pass return itemlist
def listado(item): logger.info() data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}|-\s", "", data) url_pagination = scrapertools.find_single_match( data, '<li class="current">.*?</li>[\s]<li><a href="([^"]+)">') data = scrapertools.find_single_match( data, '</div><div class="full">(.*?)<div class="pagination') matches = re.compile( '<img.+?src="([^"]+)".+?<a href="([^"]+)">(.*?)</a>.+?' '<div class="full item_info genres_info">(.*?)</div>.+?class="full">(.*?)</p>', re.DOTALL).findall(data) itemlist = [] for thumbnail, url, title, genres, plot in matches: title = clean_title(title) url = urlparse.urljoin(HOST, url) thumbnail = urlparse.urljoin(HOST, thumbnail) new_item = Item( channel=item.channel, action="episodios", title=title, url=url, thumbnail=thumbnail, contentTitle=title, plot=plot, ) if "Pelicula Anime" in genres: new_item.contentType = "movie" new_item.contentTitle = title else: new_item.contentSerieName = title new_item.context = renumbertools.context(item) itemlist.append(new_item) if url_pagination: url = urlparse.urljoin(HOST, url_pagination) title = ">> Pagina Siguiente" itemlist.append( Item(channel=item.channel, action="listado", title=title, url=url)) tmdb.set_infoLabels(itemlist, seekTmdb=True) return itemlist
def list_all(item): logger.info() itemlist = [] data = get_source(item.url) patron = '<article class="Item"><a href="([^>]+)"><div class="Poster"><img src="([^"]+)".*?' patron += '<h2>([^>]+)</h2>.*?</article>' matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedthumbnail, scrapedtitle in matches: title = scrapedtitle scrapedtitle = re.sub(' \((.*?)\)$', '', scrapedtitle) thumbnail = scrapedthumbnail.strip() url = scrapedurl filter_thumb = thumbnail.replace("https://image.tmdb.org/t/p/w154", "") filter_list = {"poster_path": filter_thumb} filter_list = filter_list.items() thumbnail = re.sub('p/w\d+', 'p/original', thumbnail) new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumbnail, infoLabels={'filtro': filter_list}) if item.type == 'peliculas' or 'peliculas' in url: new_item.action = 'findvideos' new_item.contentTitle = scrapedtitle else: new_item.action = 'seasons' new_item.contentSerieName = scrapedtitle itemlist.append(new_item) tmdb.set_infoLabels(itemlist, seekTmdb=True) # Paginación url_next_page = scrapertools.find_single_match( data, '<link rel="next" href="([^"]+)"') if url_next_page: itemlist.append( item.clone(title="Siguiente >>", url=url_next_page, action='list_all')) return itemlist
def alpha_list(item): logger.info() itemlist = list() data = create_soup(item.url) soup = data.find("tbody") if not soup: return itemlist for elem in soup.find_all("tr"): info = elem.find("td", class_="MvTbTtl") thumb = elem.find("td", class_="MvTbImg").a.img["src"] url = info.a["href"] title = info.a.text.strip() year = '' quality = '' if '/pelicula/' in url: quality = elem.find("span", class_="Qlty").text try: year = elem.find("td", text=re.compile(r"\d{4}")).text except: pass new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumb, infoLabels={"year": year}) if '/pelicula/' in url: new_item.contentTitle = title new_item.action = "findvideos" new_item.quality = quality else: new_item.contentSerieName = title new_item.action = "seasons" itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) try: next_page = data.find("a", class_="next page-numbers")["href"] itemlist.append(Item(channel=item.channel, title="Siguiente >>", url=next_page, action='list_all')) except: pass return itemlist
def list_all(item): logger.info() json_data = {"results": []} itemlist = list() for x in range(3): try: matches = httptools.downloadpage('%s%s' % (item.url, item.page)).json except: break if matches and "results" in matches: json_data["results"] += matches["results"] item.page += 1 for data in json_data["results"]: if "content" in data: elem = BeautifulSoup(data["content"], "html5lib", from_encoding="utf-8") url = host + elem.a["href"] year = scrapertools.find_single_match(data["date"], r"(\d{4})") else: url = "%s/serie/%s" % (host, data["slug"]) year = '' title = data["titulo"] thumb = data["poster"] content_id = data["ID"] new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumb, content_id=content_id, infoLabels={'year': year}, info=data) if "/serie" in url: new_item.contentSerieName = title new_item.action = "seasons" else: new_item.contentTitle = title new_item.action = "findvideos" itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) try: itemlist.append(Item(channel=item.channel, title="Siguiente >>", url=item.url, action='list_all', page=item.page + 1)) except: pass return itemlist
def search_results(item): logger.info() itemlist = [] data = get_source(item.url) patron = '<article>.*?<a href="([^"]+)"><img src="([^"]+)" alt="([^"]+)" />' patron += '<span class="([^"]+)".*?IMDb (.*?)</.*?year">([^<]+)<.*?<p>(.*?)</p>' matches = re.compile(patron, re.DOTALL).findall(data) for url, scrapedthumb, scrapedtitle, typo, rating, year, plot in matches: title = re.sub(r'\s*\((\d{4})\)$', '', scrapedtitle) contentTitle = title if not config.get_setting('unify'): rcolor = color_rating(rating) title += ' [COLOR grey](%s)[/COLOR] [COLOR %s](%s)[/COLOR]' % ( year, rcolor, rating) thumbnail = re.sub("(w\d+/)", "original/", scrapedthumb) new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumbnail, plot=plot, language='VO', infoLabels={'year': year}) if typo == 'movies': new_item.contentTitle = contentTitle new_item.action = 'findvideos' else: new_item.contentSerieName = contentTitle new_item.action = 'seasons' if not config.get_setting('unify'): new_item.title += '[COLOR blue] (Serie)[/COLOR]' itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) return itemlist
def peliculas(item): logger.info() itemlist = [] # action = '' # contentType = '' data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}| |<br>", "", data) patron = '<img class="posterentrada" src="/([^"]+)".*?' # img patron += '<a href="([^"]+)">.*?' # url patron += '<p class="description_poster">.*?\(([^<]+)\)</p>.*?' # year patron += '<div class="Description"> <div>([^<]+)</div>.*?' # plot patron += '<strong>([^<]+)</strong></h4>' # title matches = re.compile(patron, re.DOTALL).findall(data) for scrapedthumbnail, scrapedurl, year, plot, scrapedtitle in matches: new_item = Item(channel=item.channel, thumbnail=host + scrapedthumbnail, infoLabels={"year": year}, url=scrapedurl, title=scrapedtitle, plot=plot) if 'serie' in scrapedurl: new_item.action = 'temporadas' new_item.contentType = 'tvshow' new_item.contentSerieName = scrapedtitle new_item.title += ' [COLOR blue](Serie)[/COLOR]' else: new_item.action = 'findvideos' contentType = 'movie' new_item.contentTitle = scrapedtitle itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__) pagination = scrapertools.find_single_match( data, '<li><a href="([^"]+)" rel="next">') if pagination: itemlist.append(Item(channel=__channel__, action="peliculas", title="» Siguiente »", url=pagination, folder=True, text_blod=True, thumbnail=get_thumb("next.png"))) return itemlist
def list_all(item): logger.info() itemlist = list() soup = create_soup(item.url) matches = soup.find("div", class_="dt-css-grid").find_all("article") for elem in matches: url = elem.h3.a["href"] title = elem.h3.a.text thumb = elem.img["src"] year = "-" new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumb, infoLabels={"year": year}) if "serie-" in url: new_item.contentSerieName = title new_item.action = "seasons" else: new_item.contentTitle = title new_item.action = "findvideos" itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) try: url_next_page = soup.find("div", class_="pagination").find( "span", class_="current").next_sibling["href"] except: return itemlist if url_next_page and len(matches) > 16: itemlist.append( Item(channel=item.channel, title="Siguiente >>", url=url_next_page, action='list_all')) return itemlist
def list_all(item): logger.info() itemlist = list() soup = create_soup(item.url).find("div", class_="peliculas") matches = soup.find_all("div", class_="item") for elem in matches: url = elem.a["href"] title = elem.find("div", class_="fixyear").h2.text title = re.sub(r"\(\d{4}(?:-Actualidad|-\d{4})?\)", "", title) year = elem.find("span", class_="year").text thumb = elem.img["src"] new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumb, infoLabels={"year": year}) if not "series/" in url: new_item.contentTitle = title new_item.action = "findvideos" else: new_item.contentSerieName = title new_item.action = "seasons" itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) try: url_next_page = soup.find("div", class_="nav-previous").a["href"] except: return itemlist if url_next_page: itemlist.append( Item(channel=item.channel, title="Siguiente >>", url=url_next_page, action='list_all')) return itemlist
def list_all(item): logger.info() itemlist = [] media_type = item.media_type json_data = load_json(item) for media in json_data[media_type]: quality, language, plot, poster = set_extra_values(media) title = media['title'] title = set_title(title, language, quality) new_item = Item(channel=item.channel, title=title, quality=quality, language=language, plot=plot, thumbnail=poster) new_item.infoLabels['year'] = media['year'] if 'year' in media else '' new_item.infoLabels[ 'tmdb_id'] = media['tmdb_id'] if 'tmdb_id' in media else '' if 'movies_list' in json_data: new_item.url = media new_item.contentTitle = media['title'] new_item.action = 'findvideos' if 'year' in media: new_item.infoLabels['year'] = media['year'] if 'tmdb_id' in media: new_item.infoLabels['tmdb_id'] = media['tmdb_id'] else: new_item.url = media['seasons_list'] new_item.contentSerieName = media['title'] new_item.action = 'seasons' if 'year' in media: new_item.infoLabels['year'] = media['year'] if 'tmdb_id' in media: new_item.infoLabels['tmdb_id'] = media['tmdb_id'] itemlist.append(new_item) tmdb.set_infoLabels(itemlist, seekTmdb=True) return itemlist
def list_all(item): logger.info() itemlist = [] data = get_source(item.url) patron = '<article class=Item><a href=([^>]+)><div class=Poster>' patron += '<img src=(.+?)(?:>|alt).*?<h2>([^>]+)</h2>.*?</article>' matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedthumbnail, scrapedtitle in matches: title = scrapedtitle thumbnail = scrapedthumbnail.strip() url = scrapedurl filter_thumb = thumbnail.replace("https://image.tmdb.org/t/p/w154", "") filter_list = {"poster_path": filter_thumb} filter_list = filter_list.items() new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumbnail, plot=thumbnail, infoLabels={'filtro': filter_list}) if item.type == 'peliculas': new_item.action = 'findvideos' new_item.contentTitle = scrapedtitle else: new_item.action = 'seasons' new_item.contentSerieName = scrapedtitle itemlist.append(new_item) tmdb.set_infoLabels(itemlist, seekTmdb=True) # Paginación url_next_page = scrapertools.find_single_match( data, "<link rel=next href=(.*?) />") if url_next_page: itemlist.append( item.clone(title="Siguiente >>", url=url_next_page, action='list_all')) return itemlist
def lista(item): logger.info() itemlist = [] data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) patron = '<article .*?">' patron += '<a href="([^"]+)"><.*?><figure.*?>' #scrapedurl patron += '<img.*?src="([^"]+)".*?>.*?' #scrapedthumbnail patron += '<h3 class=".*?">([^"]+)<\/h3>' #scrapedtitle patron += '<span.*?>([^"]+)<\/span>.+?' #scrapedyear patron += '<a.+?>([^"]+)<\/a>' #scrapedtype matches = scrapertools.find_multiple_matches(data, patron) for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedyear, scrapedtype in matches: title = "%s - %s" % (scrapedtitle, scrapedyear) new_item = Item(channel=item.channel, title=title, url=scrapedurl, thumbnail=scrapedthumbnail, type=scrapedtype, infoLabels={'year': scrapedyear}) if scrapedtype == 'Serie': new_item.contentSerieName = scrapedtitle new_item.action = 'episodios' else: new_item.contentTitle = scrapedtitle new_item.action = 'findvideos' itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) #pagination pag = item.pag + 1 url_next_page = item.url + "/page/" + str(pag) + "/" if len(itemlist) > 19: itemlist.append( item.clone(title="Siguiente >>", url=url_next_page, action='lista', pag=pag)) return itemlist
def list_all(item): logger.info() itemlist = list() soup = create_soup(item.url) matches = soup.find("div", class_="content") for elem in matches.find_all("article", id=re.compile(r"^post-\d+")): title = elem.img["alt"] title = re.sub("VOSE", "", title) url = elem.a["href"] thumb = elem.img["data-src"] try: year = elem.find("span", text=re.compile(r"\d{4}")).text.split(",")[-1] except: pass new_item = Item(channel=item.channel, url=url, title=title, thumbnail=thumb, infoLabels={"year": year.strip()}) if "serie" in url: new_item.action = "seasons" new_item.contentSerieName = title else: new_item.action = "findvideos" new_item.contentTitle = title itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) try: next_page = soup.find_all("a", class_="arrow_pag")[-1]["href"] itemlist.append( Item(channel=item.channel, title="Siguiente >>", url=next_page, action="list_all")) except: pass return itemlist
def list_all(item): logger.info() itemlist = list() soup = create_soup(item.url) matches = soup.find("ul", id="list-view").find_all("article") for elem in matches: url = elem.find("a", class_="lnk-blk")["href"] title = elem.h2.text try: year = elem.find("span", class_="year").a.text except: year = "-" if elem.img.has_attr("data-lazy-src"): thumb = elem.img["data-lazy-src"] elif elem.img.has_attr("src"): thumb = elem.img["src"] else: thumb = "" new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumb, infoLabels={"year": year}) if "serie/" in url: new_item.contentSerieName = title new_item.action = "seasons" else: new_item.contentTitle = title new_item.action = "findvideos" itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) try: url_next_page = soup.find("a", class_="nextpostslink")["href"] except: return itemlist if url_next_page and len(matches) > 16: itemlist.append(Item(channel=item.channel, title="Siguiente >>", url=url_next_page, action='list_all')) return itemlist
def search_results(item): logger.info() itemlist = [] data = get_source(item.url) patron = '<article>.*?<a href="([^"]+)">.*?<img src="([^"]+)" alt="([^"]+)".*?<span class="(tvshows|movies)".*?' patron += '"meta".*?"year">([^<]+)<(.*?)<p>([^<]+)</p>' matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedthumb, scrapedtitle, type, year, lang_data, scrapedplot in matches: title = scrapedtitle url = scrapedurl thumbnail = scrapedthumb.replace('-150x150', '') plot = scrapedplot language = get_language(lang_data) type = re.sub('shows|s', '', type) if language: action = 'findvideos' else: action = 'seasons' new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumbnail, plot=plot, action=action, type=type, language=language, infoLabels={'year': year}) if new_item.action == 'findvideos': new_item.contentTitle = new_item.title else: new_item.contentSerieName = new_item.title itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) return itemlist
def search_results(item): logger.info() itemlist = list() url = "%swp-content/plugins/ajax-search-pro/ajax_search.php" % host post = { "action": "ajaxsearchpro_search", "aspp": item.text, "asid": "1", "asp_inst_id": "1_1", "options": "current_page_id=9&qtranslate_lang=0&filters_changed=0&filters_initial=1&asp_gen%5B%5D=title&asp_gen%5B%5D=content&asp_gen%5B%5D=excerpt&customset%5B%5D=post" } matches = create_soup(url, post=post).find_all("div", class_="asp_content") for elem in matches: url = elem.a["href"] thumb = elem.find("div", class_="asp_image asp_lazy")["data-src"] title = elem.h3.text.strip() new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumb, infoLabels={'year': '-'}) if "serie-" in url: new_item.action = "seasons" new_item.contentSerieName = new_item.title new_item.context = filtertools.context(item, list_language, list_quality) else: new_item.action = "findvideos" new_item.contentTitle = new_item.title itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) return itemlist
def list_all(item): logger.info() itemlist = list() soup = create_soup(item.url) matches = soup.find_all("div", class_="col-lg-2 col-md-4 col-6") for elem in matches: url = elem.a["href"] lang, title = clear_title(elem.find("p").text) thumb = elem.img["src"] year = elem.find("button", class_="btntwo").text c_type = elem.find("button", class_="btnone").text.lower() new_item = Item(channel=item.channel, title=title, url=url, action="episodios", language=lang, thumbnail=thumb, infoLabels={"year": year}) if c_type not in ["live action", "pelicula"]: new_item.contentSerieName = title else: new_item.contentTitle = title itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) try: url_next_page = soup.find("a", rel="next")["href"] if url_next_page and len(itemlist) > 8: itemlist.append( Item(channel=item.channel, title="Siguiente >>", url=url_next_page, action='list_all')) except: pass return itemlist
def list_all(item): logger.info() itemlist = [] full_data = get_source(item.url) data = scrapertools.find_single_match(full_data, '<div class="Posters">(.*?)</(?:ul|a></div>)') patron = 'href="([^"]+)".*?src="([^"]+)".*?<p>([^<]+)</p>' matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedthumbnail, scrapedtitle in matches: year = scrapertools.find_single_match(scrapedtitle, '(\d{4})') title = scrapertools.find_single_match(scrapedtitle, '([^\(]+)\(?').strip() thumbnail = scrapedthumbnail filter_thumb = thumbnail.replace("https://image.tmdb.org/t/p/w300", "") filter_list = {"poster_path": filter_thumb} filter_list = filter_list.items() url = scrapedurl new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumbnail, infoLabels={'filtro':filter_list, 'year':year}) if item.type == 'peliculas' or 'serie' not in url: new_item.action = 'findvideos' new_item.contentTitle = title else: new_item.action = 'seasons' new_item.contentSerieName = title itemlist.append(new_item) tmdb.set_infoLabels(itemlist, seekTmdb=True) # Paginación next_page_pattern = '<a class="page-link" href="([^"]+)" data-ci-pagination-page="\d+" rel="next">></a>' url_next_page = scrapertools.find_single_match(full_data, next_page_pattern) if url_next_page: itemlist.append(Item(channel=item.channel, title="Siguiente >>", url=url_next_page, action='list_all')) return itemlist
def list_all(item): logger.info() itemlist = list() soup = create_soup(item.url) if item.search or item.genre: matches = soup.find("div", id="movies-a").find_all("article") else: matches = soup.find("section", class_="episodes").find_all("article") for elem in matches: url = elem.a["href"] thumb = "https:" + elem.find("img")["src"] title = elem.h2.text mode = elem.find("span", class_="watch").text new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumb, infoLabels={"year": "-"}) if "caricatura" in mode.lower(): new_item.contentSerieName = title new_item.action = "seasons" else: new_item.contentTitle = title new_item.action = "findvideos" itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) try: url_next_page = soup.find("a", text="NEXT")["href"] except: return itemlist if url_next_page: itemlist.append(Item(channel=item.channel, title="Siguiente >>", url=url_next_page, action='list_all')) return itemlist
def list_all(item): logger.info() itemlist = list() soup = create_soup(item.url) matches = soup.find("div", class_="content").find_all("article", id=re.compile(r"^post-\d+")) for elem in matches: info_1 = elem.find("div", class_="poster") info_2 = elem.find("div", class_="data") thumb = info_1.img["src"] title = info_1.img["alt"] url = info_1.a["href"] try: year = info_2.find("span", text=re.compile(r"\d{4}")).text.split(",")[-1].strip() except: year = "-" new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumb, infoLabels={"year": year}) if "tvshows" in url: new_item.contentSerieName = title new_item.action = "seasons" else: new_item.contentTitle = title new_item.action = "findvideos" itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) try: url_next_page = soup.find_all("a", class_="arrow_pag")[-1]["href"] except: return itemlist itemlist.append(Item(channel=item.channel, title="Siguiente >>", url=url_next_page, action='list_all')) return itemlist
def alpha_list(item): logger.info() itemlist = list() soup = create_soup(item.url) matches = soup.find("tbody") for elem in matches.find_all("tr"): info = elem.find("td", class_="MvTbTtl") thumb = elem.img["data-lazy-src"] url = info.a["href"] title = info.a.text.strip() try: year = elem.find("td", text=re.compile(r"\d{4}")).text except: year = '-' new_item = Item(channel=item.channel, title=title, url=url, thumbnail=thumb, infoLabels={"year": year}) if elem.find("span", class_="TpTv BgA"): new_item.action = "seasons" new_item.contentSerieName = title else: new_item.action = "findvideos" new_item.contentTitle = title logger.debug(new_item) itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, True) next_page = soup.find("a", class_="next page-numbers")["href"] itemlist.append( Item(channel=item.channel, title="Siguiente >>", url=next_page, action='alpha_list')) return itemlist
def lista(item): logger.info() itemlist = [] data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) patron = '(?is)class="TPost C">.*?href="([^"]+)".*?' #scrapedurl patron += 'lazy-src="([^"]+)".*?>.*?' #scrapedthumbnail patron += 'title">([^<]+)<.*?' #scrapedtitle patron += 'year">([^<]+)<.*?' #scrapedyear patron += 'href.*?>([^"]+)<\/a>' #scrapedtype matches = scrapertools.find_multiple_matches(data, patron) for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedyear, scrapedtype in matches: if not scrapedthumbnail.startswith("http"): scrapedthumbnail = "https:" + scrapedthumbnail title = "%s - %s" % (scrapedtitle, scrapedyear) new_item = Item(channel=item.channel, title=title, url=scrapedurl, thumbnail=scrapedthumbnail, type=scrapedtype, infoLabels={'year': scrapedyear}) if scrapedtype == 'Serie': new_item.contentSerieName = scrapedtitle new_item.action = 'episodios' else: new_item.contentTitle = scrapedtitle new_item.action = 'findvideos' itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) #pagination url_next_page = scrapertools.find_single_match( data, 'rel="next" href="([^"]+)"') if len(itemlist) > 0 and url_next_page: itemlist.append( item.clone(title="Siguiente >>", url=url_next_page, action='lista')) return itemlist
def list_all(item): logger.info() itemlist = [] data = get_source(item.url) patron = '<div class="col-lg-2 col-md-3 col-6 mb-3"><a href="([^"]+)".*?<img src="([^"]+)".*?' patron += 'font-weight-500">([^<]+)<' matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedthumbnail, scrapedtitle in matches: url = urlparse.urljoin(host, scrapedurl) scrapedtitle = scrapedtitle thumbnail = scrapedthumbnail new_item = Item(channel=item.channel, title=scrapedtitle, url=url, thumbnail=thumbnail) new_item.contentSerieName = scrapedtitle new_item.action = 'seasons' new_item.context = filtertools.context(item, list_language, list_quality) itemlist.append(new_item) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) # Paginacion if itemlist != []: page_base = host + 'catalogue' next_page = scrapertools.find_single_match( data, '<a href="([^ ]+)" aria-label="Netx">') if next_page != '': itemlist.append( Item(channel=item.channel, action="list_all", title='Siguiente >>>', url=page_base + next_page, thumbnail=get_thumb("more.png"), type=item.type)) return itemlist
def listado(item): logger.info() itemlist = [] data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}| ","",data) patron = '<div class="MiniFicha">.*?' patron += '<img src="([^"]+).*?' patron += '<div class="MiniF_TitleSpecial">[^>]+>([^<]+).*?' patron += '<b>Categoria:\s*</b>([^&]+)»\s*([^<]+).*?' patron += '<div class="OpcionesDescargasMini">(.*?)</div>' matches = re.compile(patron,re.DOTALL).findall(data) for thumbnail, title, cat_padres, cat_hijos, opciones in matches: #logger.debug(thumbnail + "\n" + title + "\n" + cat_padres + "\n" + cat_hijos + "\n" + opciones) # Obtenemos el año del titulo y eliminamos lo q sobre patron = '\d{4}$' year = scrapertools.find_single_match(title,patron) if year: title = re.sub(patron, "", title) patron = '\s?-?\s?(line)?\s?-\s?$' title = re.sub(patron, "", title,flags=re.IGNORECASE) # Obtenemos la imagen b por q es mayor thumbnail = HOST + thumbnail[:-5] + 'b' + thumbnail[-4:] # Buscamos opcion de ver online patron = '<a href="http://estrenosly.org/ver-online-([^"]+)' url_ver = scrapertools.find_single_match(opciones, patron) if url_ver: new_item = Item(channel=item.channel, action="findvideos", title=title, thumbnail=thumbnail, url=url_ver, infoLabels={"year":year}, text_color = color1) cat_padres = cat_padres.strip() if cat_padres in ["peliculas-dvdrip", "HDRIP", "cartelera"]: #if item.extra == 'movie': new_item.contentTitle = title new_item.extra = "movie" # Filtramos nombres validos para la calidad patron = ("rip|dvd|screener|hd|ts|Telesync") if re.search(patron,cat_hijos,flags=re.IGNORECASE): new_item.contentQuality = cat_hijos new_item.title = "%s [%s]" % (title, cat_hijos) elif cat_padres == "peliculas-dvdrip": new_item.contentQuality = "DVDRIP" new_item.title = "%s [DVDRIP]" % title elif cat_padres == "HDRIP": new_item.contentQuality = "HDRIP" new_item.title = "%s [HDRIP]" % title elif cat_padres == "series": new_item.contentSerieName = cat_hijos patron = re.compile('(\d+)x(\d+)') matches = patron.findall(title) if len(matches) == 1: new_item.contentSeason = matches[0][0] new_item.contentEpisodeNumber = matches[0][1].zfill(2) new_item.extra = "episodie" else: # matches == [('1', '01'), ('1', '02'), ('1', '03')] new_item.extra = "multi-episodie" else: #Otras categorias q de momento no nos interesan continue ''' Opcionalmente podriamos obtener los enlaces torrent y descargas directas patron = '<a href="http://estrenosli.org/descarga-directa-([^"]+)' new_item.url_descarga = scrapertools.find_single_match(opciones,patron) patron = '<a href="http://estrenosli.org/descargar-torrent-([^"]+).*?' new_item.url_torrent = scrapertools.find_single_match(opciones,patron)''' itemlist.append(new_item) if itemlist: # Obtenemos los datos basicos de todas las peliculas mediante multihilos tmdb.set_infoLabels(itemlist) # Si es necesario añadir paginacion patron = '<div class="sPages">.*?' patron += '<a href="([^"]+)">Siguiente' url_next_page = scrapertools.find_single_match(data,patron) if url_next_page: itemlist.append(Item(channel=item.channel, action="listado", title=">> Página siguiente", thumbnail=thumbnail_host, url=HOST + url_next_page, folder=True, text_color = color3, text_blod=True)) return itemlist