# -*- coding: utf-8 -*- # ------------------------------------------------------------ # Canale per Filmsenzalimiti CC # ------------------------------------------------------------ import re try: import urlparse except: import urllib.parse as urlparse from core import scrapertools, servertools, httptools from core import tmdb from core.item import Item from platformcode import config from platformcode import logger from specials import autoplay # Necessario per Autoplay host = config.get_channel_url() IDIOMAS = {'Italiano': 'IT'} list_language = IDIOMAS.values() list_servers = ['verystream', 'openload', 'vidlox', 'youtube'] list_quality = ['default'] # Necessario per Verifica Link checklinks = config.get_setting('checklinks', 'filmsenzalimiticc') checklinks_number = config.get_setting('checklinks_number', 'filmsenzalimiticc') headers = [['Referer', host]] def mainlist(item): logger.info('[filmsenzalimiticc.py] mainlist') autoplay.init(item.channel, list_servers, list_quality) # Necessario per Autoplay # Menu Principale itemlist = [Item(channel=item.channel, action='video', title='Film', url=host, contentType='movie', thumbnail=''), Item(channel=item.channel, action='sottomenu_film', title='Categorie Film', url=host, contentType='movie', thumbnail=''), Item(channel=item.channel, action='video', title='Serie TV', url=host+'/serie-tv/', contentType='tvshow', thumbnail=''), Item(channel=item.channel, action='sottomenu_serie', title='[B]Categorie Serie TV[/B]', thumbnail=''), Item(channel=item.channel, action='search', extra='tvshow', title='[B]Cerca... (non funziona)[/B]', thumbnail='') ] autoplay.show_option(item.channel, itemlist) # Necessario per Autoplay (Menu Configurazione) return itemlist def search(item, texto): logger.info('[filmsenzalimiticc.py] search') item.url = host + '/?s=' + texto try: return video(item) # Continua la ricerca in caso di errore . except: import sys for line in sys.exc_info(): logger.error('%s' % line) return [] def sottomenu_film(item): logger.info('[filmsenzalimiticc.py] sottomenu_film') itemlist = [] # Carica la pagina data = httptools.downloadpage(item.url).data # Estrae i contenuti patron = "
  • (.*?)<" matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedtitle in matches: itemlist.append( Item(channel=__channel__, action='video', contentType=item.contentType, title=scrapedtitle, url=scrapedurl)) # Elimina le Serie al Sottomenù itemlist.pop(3) itemlist.pop(29) itemlist.pop(29) itemlist.pop(32) return itemlist def sottomenu_serie(item): logger.info('[seriehd.py] sottomenu_serie') itemlist = [ Item(channel=item.channel, action='video', title='Serie TV HD', url=host+'/watch-genre/serie-altadefinizione/', contentType='tvshow', thumbnail=''), Item(channel=item.channel, action='video', title='Miniserie', url=host+'/watch-genre/miniserie/', contentType='tvshow', thumbnail=''), Item(channel=item.channel, action='video', title='Programmi TV', url=host+'/watch-genre/programmi-tv/', contentType='tvshow', thumbnail='') ] return itemlist def video(item): logger.info('[filmsenzalimiticc.py] video') itemlist = [] # Carica la pagina data = httptools.downloadpage(item.url).data.replace('\n','').replace('\t','') # Estrae i contenuti patron = r'
    .*?([^"]+) (\(.*?)streaming<\/p>.*?

    \s*(\S+).*?<\/p>' matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedyear, scrapedquality in matches: scrapedthumbnail = httptools.get_url_headers(scrapedthumbnail) scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle) scrapedyear = scrapertools.decodeHtmlentities(scrapedyear) scrapedquality = scrapertools.decodeHtmlentities(scrapedquality) year = scrapedyear.replace('(','').replace(')','') infolabels = {} if year: infolabels['year'] = year title = scrapedtitle + ' '+ scrapedyear +' [' + scrapedquality + ']' # Seleziona fra Serie TV e Film if item.contentType == 'movie': azione = 'findvideos' tipologia = 'movie' if item.contentType == 'tvshow': azione='episodios' tipologia = 'tv' itemlist.append( Item(channel=item.channel, action=azione, contentType=item.contentType, title=title, fulltitle=scrapedtitle, text_color='azure', url=scrapedurl, thumbnail=scrapedthumbnail, infoLabels=infolabels, show=scrapedtitle)) # Next page next_page = scrapertools.find_single_match(data, '