# -*- coding: utf-8 -*- # ------------------------------------------------------------ # Canale per casacinema # ------------------------------------------------------------ from core import scrapertoolsV2, httptools, servertools, tmdb, support from core.item import Item from platformcode import logger, config from specials import autoplay __channel__ = "casacinemainfo" host = config.get_channel_url(__channel__) IDIOMAS = {'Italiano': 'IT'} list_language = IDIOMAS.values() list_servers = ['verystream', 'openload', 'wstream', 'speedvideo'] list_quality = ['1080p', '720', '480p', '360p'] checklinks = config.get_setting('checklinks', 'casacinema') checklinks_number = config.get_setting('checklinks_number', 'casacinema') def mainlist(item): logger.info("alfa.casacinema mainlist") autoplay.init(item.channel, list_servers, list_quality) itemlist = [Item(channel=item.channel, title="Film", action="peliculas", extra="movie", url=host, thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"), Item(channel=item.channel, title="In sala", action="peliculas", extra="movie", url="%s/category/in-sala/" % host, thumbnail="http://jcrent.com/apple%20tv%20final/HD.png"), Item(channel=item.channel, title="Novità", action="peliculas", extra="movie", url="%s/category/nuove-uscite/" % host, thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"), Item(channel=item.channel, title="Sub - Ita", action="peliculas", extra="movie", url="%s/category/sub-ita/" % host, thumbnail="http://i.imgur.com/qUENzxl.png"), Item(channel=item.channel, title="[COLOR yellow]Cerca...[/COLOR]", action="search", extra="movie", thumbnail="http://dc467.4shared.com/img/fEbJqOum/s7/13feaf0c8c0/Search")] autoplay.show_option(item.channel, itemlist) return itemlist def search(item, texto): logger.info("[casacinemaInfo.py] " + item.url + " search " + texto) item.url = host + "/?s=" + texto data = httptools.downloadpage(item.url).data itemlist = [] patron = '
  • .*?([^<>]+)

    ' matches = scrapertoolsV2.find_multiple_matches(data, patron) for scrapedurl, scrapedtitle, scrapedthumbnail, scrapedyear, scrapedplot in matches: title = scrapertoolsV2.decodeHtmlentities(scrapedtitle) cleantitle = title.replace('[Sub-ITA]', '').strip() infoLabels = {"plot": scrapertoolsV2.decodeHtmlentities(scrapedplot), "year": scrapedyear} itemlist.append( Item(channel=item.channel, action="findvideos", contentType="movie", title=title, url=scrapedurl, thumbnail=scrapedthumbnail, infoLabels=infoLabels, fulltitle=cleantitle)) tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) return itemlist def peliculas(item): logger.info("[casacinemaInfo.py] peliculas") itemlist = [] # Carica la pagina data = httptools.downloadpage(item.url).data # Estrae i contenuti patron = '
    [^<>]+