# -*- coding: utf-8 -*- # ------------------------------------------------------------ # Ringraziamo Icarus crew # Canale per marapcana # ------------------------------------------------------------ import re from core import scrapertools, httptools, servertools from core.item import Item from core import tmdb from lib import unshortenit from platformcode import logger, config host = "http://marapcana.live" # in caso di oscuramento verificare l'indirizzo http://marapcana.online/ headers = [['Referer', host]] PERPAGE = 12 def mainlist(item): logger.info(" mainlist") # Main options itemlist = [Item(channel=item.channel, action="peliculas", title="[COLOR azure]Film[/COLOR]", url="%s/film-categoria/dvdrip-bdrip/" % host, extra="movie", thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"), Item(channel=item.channel, action="categorie", title="[COLOR azure]Categorie[/COLOR]", url="%s/elenchi-film/" % host, extra="movie", thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"), Item(channel=item.channel, action="search", title="[COLOR yellow]Cerca...[/COLOR]", extra="movie", thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"), Item(channel=item.channel, action="peliculas_tv", title="[COLOR azure]Serie TV[/COLOR]", url="%s/lista-serie-tv/" % host, extra="tvshow", thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"), Item(channel=item.channel, action="search", title="[COLOR yellow]Cerca SerieTV...[/COLOR]", extra="tvshow", thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png")] return itemlist def peliculas(item): logger.info(" peliculas") itemlist = [] data = httptools.downloadpage(item.url, headers=headers).data patron = '' matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedtitle in matches: scrapedthumbnail = "" itemlist.append( Item(channel=item.channel, action="findvideos", fulltitle=scrapedtitle, show=scrapedtitle, title=scrapedtitle, url=scrapedurl, thumbnail=scrapedthumbnail, extra=item.extra, viewmode="movie_with_plot", Folder=True)) nextpage_regex = '' next_page = scrapertools.find_single_match(data, nextpage_regex) if next_page != "": itemlist.append( Item(channel=item.channel, action="peliculas", title="[COLOR lightgreen]" + config.get_localized_string(30992) + "[/COLOR]", url="%s" % next_page, extra=item.extra, thumbnail="http://2.bp.blogspot.com/-fE9tzwmjaeQ/UcM2apxDtjI/AAAAAAAAeeg/WKSGM2TADLM/s1600/pager+old.png")) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) return itemlist def categorie(item): itemlist = [] if item.url == "": item.url = host data = httptools.downloadpage(item.url, headers=headers).data bloque = scrapertools.get_match(data, 'Genere(.*?)') patron = '' matches = re.compile(patron, re.DOTALL).findall(bloque) for scrapedurl, scrapedtitle in matches: if "adesso" in scrapedtitle: continue itemlist.append( Item(channel=item.channel, action="peliculas", fulltitle=scrapedtitle, title=scrapedtitle, url=scrapedurl, viewmode="movie_with_plot", Folder=True)) return itemlist def peliculas_tv(item): itemlist = [] if item.url == "": item.url = host p = 1 if '{}' in item.url: item.url, p = item.url.split('{}') p = int(p) data = httptools.downloadpage(item.url, headers=headers).data bloque = scrapertools.get_match(data, 'Lista Serie Tv(.*?)') patron = '([^<]+)' matches = re.compile(patron, re.DOTALL).findall(bloque) scrapedplot = "" scrapedthumbnail = "" for i, (scrapedurl, scrapedtitle) in enumerate(matches): if (p - 1) * PERPAGE > i: continue if i >= p * PERPAGE: break title = scrapertools.decodeHtmlentities(scrapedtitle) itemlist.append( Item(channel=item.channel, extra=item.extra, action="episodios", title=title, url=scrapedurl, thumbnail=scrapedthumbnail, fulltitle=title, show=title, plot=scrapedplot, folder=True)) if len(matches) >= p * PERPAGE: scrapedurl = item.url + '{}' + str(p + 1) itemlist.append( Item(channel=item.channel, extra=item.extra, action="peliculas_tv", title="[COLOR lightgreen]" + config.get_localized_string(30992) + "[/COLOR]", url=scrapedurl, thumbnail="http://2.bp.blogspot.com/-fE9tzwmjaeQ/UcM2apxDtjI/AAAAAAAAeeg/WKSGM2TADLM/s1600/pager+old.png", folder=True)) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) return itemlist def episodios(item): itemlist = [] if item.url == "": item.url = host if host not in item.url: item.url = '%s%s' % (host, item.url) data = httptools.downloadpage(item.url, headers=headers).data bloque = scrapertools.find_single_match(data, '