diff --git a/channels/cinemalibero.json b/channels/cinemalibero.json index 820ef7bb..72ca5d06 100644 --- a/channels/cinemalibero.json +++ b/channels/cinemalibero.json @@ -6,7 +6,7 @@ "adult": false, "thumbnail": "cinemalibero.png", "banner": "cinemalibero.png", - "categories": ["movie","tvshow","anime"], - "not_active": ["include_in_newest"], + "categories": ["movie","tvshow"], + "not_active": ["include_in_newest_anime"], "settings": [] } diff --git a/channels/cinemalibero.py b/channels/cinemalibero.py index bbb8e0d1..9bbf173a 100644 --- a/channels/cinemalibero.py +++ b/channels/cinemalibero.py @@ -5,27 +5,14 @@ """ Questi sono commenti per i beta-tester. - Su questo canale in: - - Cerca ( nel canale ) e Ricerca Globale - - SerieTV e novità del canale - - Novità -> SerieTV - non saranno presenti le voci: - - 'Aggiungi alla Videoteca', - - 'Scarica Serie' - - NON SONO PRESENTI IN NOVITà GLOBALE E del CANALE RIGUARDANTI LO SPORT!!!! - dunque, la loro assenza, nel Test, NON dovrà essere segnalata come ERRORE. + 25 titoli per le novità di qualsiasi sezione. - NON CONTROLLARE LA SEZIONE SPORT, HA PROBLEMI!!! + NON CONTROLLARE LE SEZIONE SPORT - ANIME, HANNO PROBLEMI!!! è stata eliminata dall'elenco ma i titoli possono apparire nella ricerca o tra le novità Non è errore se dà problemi!!! NON CONSIDERATELA! Novità. Indicare in quale/i sezione/i è presente il canale: - - FILM - - Avvisi: - - Eventuali avvisi per i tester - - Ulteriori info: + - FILM - SERIE """ @@ -35,12 +22,11 @@ from core import httptools, support, scrapertoolsV2 from core.item import Item from platformcode import config -list_servers = ['akstream', 'wstream', 'backin', 'verystream', 'openload', 'streamango'] +list_servers = ['akstream', 'wstream', 'backin'] list_quality = ['default'] __channel__ = "cinemalibero" host = config.get_channel_url(__channel__) - headers = [['Referer', host]] @support.menu @@ -54,19 +40,19 @@ def mainlist(item): tvshow = ['/category/serie-tv/' ] - Anime = [(support.typo('Anime', 'bullet bold'),['/category/anime-giapponesi/', 'peliculas', 'anime', 'tvshow']) - ] - -## Sport = [(support.typo('Sport', 'bullet bold'), ['/category/sport/', 'peliculas', '', 'tvshow']) +## Anime = [(support.typo('Anime', 'bullet bold'),['/category/anime-giapponesi/', 'peliculas', 'anime', 'tvshow']) ## ] -## news = [('Novità Serie-Anime', ['/aggiornamenti-serie-tv/', 'peliculas', 'update', 'tvshow'])] + +## Sport = [(support.typo('Sport', 'bullet bold'), ['/category/sport/', 'peliculas', 'sport', 'tvshow']) +## ] + news = [('Novità Serie-Anime', ['/aggiornamenti-serie-tv/', 'peliculas', 'update', 'tvshow'])] + search = '' return locals() @support.scrape -#def video(item): def peliculas(item): support.log() #debug = True @@ -77,10 +63,11 @@ def peliculas(item): elif item.args == 'anime': patron = r'
[^>]+>[^>]+>\s[^\)]+)\)">[^>]+>[^>]+>[^>]+>\s?(?P[\d\.]+)?[^>]+>[^>]+>(?P.+?)\(?(?P<year>\d+)?\)?<[^>]+>[^>]+>(?:.+?[^fFiInNeE]+?\(?(?P<lang>[sSuUbBiItTaA]+)\)?.+?)<' elif item.args == 'update': - action = 'select' + pagination = 25 patron = r'<div class="card-body p-0">\s<a href="(?P<url>[^"]+)".+?url\((?P<thumb>.+?)\)">\s<div class="titolo">(?P<title>.+?)(?: – Serie TV)?(?:\([sSuUbBiItTaA\-]+\))?[ ]?(?P<year>\d{4})?</div>[ ]<div class="genere">(?:[\w]+?\.?\s?[\s|S]?[\dx\-S]+?\s\(?(?P<lang>[iItTaA]+|[sSuUbBiItTaA\-]+)\)?\s?(?P<quality>[HD]+)?|.+?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?</div>)' else: - patron = r'<div class="col-lg-3">[^>]+>[^>]+>\s<a href="(?P<url>[^"]+)".+?url\((?P<thumb>[^\)]+)\)">[^>]+>[^>]+>[^>]+>(?:[^>]+>)?\s?(?P<rating>[\d\.]+)?[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>(.?[\d\-x]+\s\(?(?P<lang>[sSuUbBiItTaA\-]+)?\)?\s?(?P<quality>[\w]+)?[|]?\s?(?:[fFiInNeE]+)?\s?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?)?' + #search + patron = r'<div class="col-lg-3">[^>]+>[^>]+>\s<a href="(?P<url>[^"]+)".+?url\((?P<thumb>[^\)]+)\)">[^>]+>[^>]+>[^>]+>(?:[^>]+>)?\s?(?P<rating>[\d\.]+)?[^>]+>(?P<title>.+?)(?:[ ]\((?P<year>\d{4})\))?<[^>]+>[^>]+>(.?[\d\-x]+\s\(?(?P<lang>[sSuUbBiItTaA\-]+)?\)?\s?(?P<quality>[\w]+)?[|]?\s?(?:[fFiInNeE]+)?\s?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?)?' def itemHook(item): if item.lang2: @@ -89,15 +76,35 @@ def peliculas(item): item.contentLanguage = item.lang2 item.title += support.typo(item.lang2, '_ [] color kod') - if item.contentType == 'movie': - item.action = 'findvideos' - elif item.args == 'anime' or item.args == 'update' or item.args == 'search': - item.action = 'select' - elif item.contentType == 'tvshow': - item.extra = 'serie' + data = httptools.downloadpage(item.url, headers=headers).data + block = scrapertoolsV2.find_single_match(data, r'Streaming\s?[\w]+?:(.*?)<\/div>') + if re.findall('rel="category tag">serie', data, re.IGNORECASE): + support.log('select = ### è una serie ###') item.action = 'episodios' + item.contentType = 'tvshow' +## elif re.findall('rel="category tag">sport', data, re.IGNORECASE): +## support.log('select = ### è un documentario sportivo ###') +## item.action = 'findvideos' +## item.contentType = 'movie' +## elif re.findall('rel="category tag">Wrestling WWE', data, re.IGNORECASE): +## support.log('select = ### è una serie ###') +## item.action = 'episodios' +## item.contentType = 'tvshow' + elif re.findall('rel="category tag">anime', data, re.IGNORECASE): + if re.findall('episodio', block, re.IGNORECASE) or re.findall('episodi streaming', block, re.IGNORECASE) or \ + re.findall('numero stagioni', data, re.IGNORECASE): + support.log('select = ### è un anime ###') + item.action = 'episodios' + item.contentType = 'tvshow' + args='anime' + else: + support.log('select anime ELSE = ### è un film ###') + contentType='movie' + item.action = 'findvideos' else: - item.action = 'select' + support.log('select ELSE = ### è un film ###') + item.action = 'findvideos' + item.contentType='movie' return item @@ -106,33 +113,23 @@ def peliculas(item): return locals() @support.scrape -def episodios(item): # Questa def. deve sempre essere nominata episodios +def episodios(item): support.log() - if item.extra == 'serie' or item.contentType == 'tvshow': + if item.args == 'anime': + support.log("Anime :", item) + blacklist = ['Clipwatching', 'Verystream', 'Easybytez', 'Flix555'] + patron = r'<a target=(?P<url>[^>]+>(?P<title>[^<]+))(?:</a></p>|</a><br />)' + patronBlock = r'Streaming.+?:(?P<block>.*?)</div>' + item.contentType = 'tvshow' + item.contentSerieName = item.fulltitle + else:# item.extra == 'serie': support.log("Serie :", item) patron = r'(?P<episode>\d+(?:×|×)?\d+\-\d+|\d+(?:×|×)\d+)[;]?[ ]?(?:(?P<title>[^<]+)(?P<url>.*?)|(\2[ ])(?:<(\3.*?)))(?:</a><br />|</a></p>)' patronBlock = r'<p><strong>(?P<block>(?:.+?[Ss]tagione.+?(?P<lang>iTA|ITA|Sub-ITA|Sub-iTA))?(?:|.+?|</strong>)(/?:</span>)?</p>.*?</p>)' item.contentType = 'tvshow' item.contentSerieName = item.fulltitle - elif item.args == 'anime': - support.log("Anime :", item) - blacklist = ['Clipwatching', 'Verystream', 'Easybytez', 'Flix555'] - #patron = r'(?:href="[ ]?(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+))<|(?P<episode>\d+(?:×|×)?\d+\-\d+|\d+(?:×|×)\d+)[;]?(?:(\4[^<]+)(\2.*?)|(\2[ ])(?:<(\3.*?)))(?:</a><br />|</a></p>)' - #patron = r'<a target=.+?href="(?P<url>[^"]+)"[^>]+>(?P<title>(Epis|).+?(?P<episode>\d+)?)(?:\((?P<lang>Sub ITA)\))?</a>(?:<br />)?' - patron = r'<a target=(?P<url>.+?(?:rel="noopener noreferrer">(?P<title>[^<]+)))</a>.+?(?:</a></p>|</a><br />)' - patronBlock = r'Streaming.+?:(?P<block>.*?)</div>' - #patronBlock = r'(?:<p>)?(?P<block>.*?)(?:</a><br /> |</p><div)' - item.contentType = 'tvshow' - item.contentSerieName = item.fulltitle - else: - support.log('extra = else --- select = ### è un film ###') - return findvideos(Item(channel=item.channel, - title=item.title, - fulltitle=item.fulltitle, - url=item.url, - show=item.fulltitle, - contentType='movie')) + #debug = True return locals() @@ -147,46 +144,6 @@ def genres(item): return locals() -def select(item): - support.log() - - data = httptools.downloadpage(item.url, headers=headers).data - block = scrapertoolsV2.find_single_match(data, r'Streaming\s?[\w]+?:(.*?)<\/div>') - if re.findall('rel="category tag">serie', data, re.IGNORECASE): - support.log('select = ### è una serie ###') - return episodios(Item(channel=item.channel, - title=item.title, - fulltitle=item.fulltitle, - contentSerieName = item.fulltitle, - url=item.url, - extra='serie', - contentType='episode')) - elif re.findall('rel="category tag">anime', data, re.IGNORECASE): - if re.findall('episodio', block, re.IGNORECASE) or re.findall('episodi streaming', block, re.IGNORECASE) or \ - re.findall('numero stagioni', data, re.IGNORECASE): - support.log('select = ### è un anime ###') - return episodios(Item(channel=item.channel, - title=item.title, - fulltitle=item.fulltitle, - contentSerieName = item.fulltitle, - url=item.url, - args='anime', - contentType='episode')) - else: - support.log('select anime ELSE = ### è un film ###') - return findvideos(Item(channel=item.channel, - title=item.title, - fulltitle=item.fulltitle, - url=item.url, - contentType='movie')) - else: - support.log('select ELSE = ### è un film ###') - return findvideos(Item(channel=item.channel, - title=item.title, - fulltitle=item.fulltitle, - url=item.url, - contentType='movie')) - def search(item, texto): support.log(item.url,texto) item.url = host + "/?s=" + texto @@ -209,22 +166,19 @@ def newest(categoria): if categoria == 'peliculas': item.url = host+'/category/film/' item.contentType = 'movie' -## item.action = 'peliculas' -## itemlist = peliculas(item) -## elif categoria == 'series': -## item.contentType = 'tvshow' -## item.args = 'update' -## item.url = host+'/aggiornamenti-serie-tv/' + elif categoria == 'series' or categoria == 'anime': + item.args = 'update' + item.url = host+'/aggiornamenti-serie-tv/' item.action = 'peliculas' itemlist = peliculas(item) - if itemlist[-1].action == 'peliculas': - itemlist.pop() +## if itemlist[-1].action == 'peliculas': +## itemlist.pop() # Continua la ricerca in caso di errore except: import sys for line in sys.exc_info(): - support.log('newest log: ', {0}.format(line)) + support.log('newest log: ', (line)) return [] return itemlist