# -*- coding: utf-8 -*- # ------------------------------------------------------------ # Ringraziamo Icarus crew # Canale per guardogratis # # ---------------------------------------------------------- import re import urlparse from core import httptools from core import scrapertools from core import servertools from core import tmdb from core.item import Item from platformcode import logger, config __channel__ = "guardogratis" host = config.get_channel_url(__channel__) headers = [['Referer', host]] def mainlist(item): logger.info("[guardogratis.py] mainlist") # Main options itemlist = [Item(channel=item.channel, action="list_titles", title="[COLOR azure]Film[/COLOR]", url="%s/movies/" % 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="list_titles", title="[COLOR azure]Top Film[/COLOR]", url="%s/top-imdb/" % 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" % host, extra="categorie", 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="list_titles", title="[COLOR azure]Serie Tv[/COLOR]", url="%s/series/" % 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 Film[/COLOR]", extra="movie", thumbnail="http://dc467.4shared.com/img/fEbJqOum/s7/13feaf0c8c0/Search"), Item(channel=item.channel, action="search", title="[COLOR yellow]Cerca SerieTV[/COLOR]", extra="tvshow", thumbnail="http://dc467.4shared.com/img/fEbJqOum/s7/13feaf0c8c0/Search")] return itemlist def list_titles(item): logger.info("[guardogratis.py] list_titles") itemlist = [] tipo='movie' if 'tvshow' in item.extra: tipo='tv' if item.url == "": item.url = host # Carica la pagina data = httptools.downloadpage(item.url, headers=headers).data patronvideos = '