diff --git a/channels.json b/channels.json index 3f9214aa..88a7e56b 100644 --- a/channels.json +++ b/channels.json @@ -7,11 +7,11 @@ "animestream": "https://www.animeworld.it", "animesubita": "http://www.animesubita.org", "animetubeita": "http://www.animetubeita.com", - "animeworld": "https://www.animeworld.cc", "animeunity": "https://www.animeunity.it", + "animeworld": "https://www.animeworld.cc", "casacinema": "https://www.casacinema.biz", "casacinemaInfo": "https://casacinema.kim", - "cb01anime": "https://www.cineblog01.ink", + "cb01anime": "https://www.cineblog01.ink", "cinetecadibologna": "http://cinestore.cinetecadibologna.it", "documentaristreamingda": "https://documentari-streaming-da.com", "dreamsub": "https://dreamsub.stream", @@ -24,15 +24,15 @@ "guardarefilm": "https://www.guardarefilm.red", "guardaserie_stream": "https://guardaserie.store", "guardaserieclick": "https://www.guardaserie.media", - "ilgeniodellostreaming": "https://igds.one", + "ilgeniodellostreaming": "https://igds.se", "italiaserie": "https://italiaserie.org", "mondoserietv": "https://mondoserietv.com", - "netfreex": "https://www.netfreex.icu", + "netfreex": "https://www.netfreex.pro", "piratestreaming": "https://www.piratestreaming.gratis", "polpotv": "https://polpo.tv", "pufimovies": "https://pufimovies.com", "seriehd": "https://www.seriehd.watch", - "serietvonline": "https://serietvonline.monster", + "serietvonline": "https://serietvonline.icu", "serietvsubita": "http://serietvsubita.xyz", "serietvu": "https://www.serietvu.link", "streamingaltadefinizione": "https://www.popcornstream.best", diff --git a/channels/seriehd.py b/channels/seriehd.py index 95536858..d51a4312 100644 --- a/channels/seriehd.py +++ b/channels/seriehd.py @@ -17,43 +17,14 @@ list_quality = ['1080p', '720p', '480p', '360'] @support.menu def mainlist(item): - tvshow = [('Genere', ['', 'genre']), - ('Americane', ['/serie-tv-streaming/serie-tv-americane', 'peliculas']), - ('Italiane', ['/serie-tv-streaming/serie-tv-italiane', 'peliculas']),] - return locals() - - -@support.scrape -def peliculas(item): - patron = r'

(?P.*?)</h2>\s*<img src="(?P<thumb>[^"]+)" alt="[^"]*" />\s*<A HREF="(?P<url>[^"]+)">.*?<span class="year">(?:(?P<year>[0-9]{4}))?.*?<span class="calidad">(?:(?P<quality>[A-Z]+))?.*?</span>' - patronNext=r'<span class="current">\d+</span><a rel="nofollow" class="page larger" href="([^"]+)">\d+</a>' - action='episodios' - return locals() - - -@support.scrape -def episodios(item): - data ='' - url = support.match(item, patron=r'<iframe width=".+?" height=".+?" src="([^"]+)" allowfullscreen frameborder="0">').match - seasons = support.match(url, patron=r'<a href="([^"]+)">(\d+)<', patronBlock=r'<h3>STAGIONE</h3><ul>(.*?)</ul>', headers=headers).matches - for season_url, season in seasons: - season_url = support.urlparse.urljoin(url, season_url) - episodes = support.match(season_url, patron=r'<a href="([^"]+)">(\d+)<', patronBlock=r'<h3>EPISODIO</h3><ul>(.*?)</ul>', headers=headers).matches - for episode_url, episode in episodes: - episode_url = support.urlparse.urljoin(url, episode_url) - title = season + "x" + episode.zfill(2) + ' - ' + item.fulltitle - data += title + '|' + episode_url + '\n' - patron = r'(?P<title>[^\|]+)\|(?P<url>[^\n]+)\n' - action = 'findvideos' - return locals() - - -@support.scrape -def genre(item): - patronMenu = '<a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a>' - blacklist = ['Serie TV','Serie TV Americane','Serie TV Italiane','altadefinizione'] - patronBlock = '<ul class="sub-menu">(?P<block>.*)</ul>' - action = 'peliculas' + tvshow = [('Genere', ['', 'menu', 'genre']), + ('A-Z', ['', 'menu', 'a-z']), + ('In Corso', ['/category/serie-tv-streaming/serie-in-corso', 'peliculas']), + ('Complete', ['/category/serie-tv-streaming/serie-complete', 'peliculas']), + ('Americane', ['/category/serie-tv-streaming/serie-tv-americane', 'peliculas']), + ('Italiane', ['/category/serie-tv-streaming/serie-tv-italiane', 'peliculas']), + ('Ultimi Episodi', ['/aggiornamenti', 'peliculas', 'last']), + ('Evidenza', ['', 'peliculas', 'best'])] return locals() @@ -72,17 +43,18 @@ def search(item, texto): support.logger.error("%s" % line) return [] + def newest(categoria): support.log(categoria) itemlist = [] item = support.Item() + item.url = host + '/aggiornamenti' + item.args = 'last' try: if categoria == "series": - item.url = host item.contentType = 'tvshow' - itemlist = peliculas(item) - itemlist.pop() + return peliculas(item) # Continua la ricerca in caso di errore except: import sys @@ -93,6 +65,55 @@ def newest(categoria): return itemlist +@support.scrape +def peliculas(item): + if item.args == 'last': + action = 'findvideos' + patron = r'singleUpdate">[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>\s*<h2>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+>\s*(?P<season>\d+)\D+(?P<episode>\d+)(?:[^\(]*\()?(?P<lang>[^\)]+)?(?:\))?' + elif item.args == 'best': + action='episodios' + patron = r'col-md-3">\s*<a href="(?P<url>[^"]+)">[^>]+>\s*<div class="infoVetrina">[^>]+>(?P<year>\d{4})[^>]+>[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)[^>]+>[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"' + else: + action='episodios' + patron = r'<a href="(?P<url>[^"]+)">[^>]+>\s*<div class="infoSeries">\s*<h2>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)?[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>(?P<quality>[^<]+)<[^>]+>[^>]+>(?P<year>\d{4})' + patronNext=r'next page-numbers" href="([^"]+)"' + + return locals() + + +@support.scrape +def episodios(item): + data ='' + url = support.match(item, patron=r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen').match + seasons = support.match(url, patron=r'<a href="([^"]+)">(\d+)<', patronBlock=r'<h3>STAGIONE</h3><ul>(.*?)</ul>', headers=headers).matches + for season_url, season in seasons: + season_url = support.urlparse.urljoin(url, season_url) + episodes = support.match(season_url, patron=r'<a href="([^"]+)">(\d+)<', patronBlock=r'<h3>EPISODIO</h3><ul>(.*?)</ul>', headers=headers).matches + for episode_url, episode in episodes: + episode_url = support.urlparse.urljoin(url, episode_url) + title = season + "x" + episode.zfill(2) + ' - ' + item.fulltitle + data += title + '|' + episode_url + '\n' + patron = r'(?P<title>[^\|]+)\|(?P<url>[^\n]+)\n' + action = 'findvideos' + return locals() + + +@support.scrape +def menu(item): + if item.args == 'genre': + patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a>' + else: + patronMenu = r'<a href="(?P<url>[^"]+)" class="">(?P<title>[^<]+)' + + blacklist = ['Serie TV Streaming','Serie TV Americane','Serie TV Italiane','Serie Complete','Serie in Corso','altadefinizione'] + action = 'peliculas' + return locals() + + def findvideos(item): - support.log() + support.log(item) + if item.args == 'last': + url = support.match(item, patron = r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen').match + matches = support.match(url,patron=r'<a href="([^"]+)">(\d+)<', patronBlock=r'<h3>EPISODIO</h3><ul>(.*?)</ul>').matches + if matches: item.url = support.urlparse.urljoin(url, matches[-1][0]) return support.hdpass_get_servers(item) diff --git a/channelselector.py b/channelselector.py index ebc672a2..a0804291 100644 --- a/channelselector.py +++ b/channelselector.py @@ -424,14 +424,14 @@ def thumb(itemlist=[], genre=False, thumb=''): item.thumbnail = get_thumb(thumb + '.png') else: item.thumbnail = get_thumb(thumb + '.png') else: - thumb = item.thumbnails + thumb = item.thumbnail else: for thumb, titles in icon_dict.items(): if any(word in re.split(r'\.|\{|\}|\[|\]|\(|\)| ',item.title.lower()) for word in titles ): item.thumbnail = get_thumb(thumb + '.png') else: - thumb = item.thumbnails + thumb = item.thumbnail item.title = re.sub(r'\s*\{[^\}]+\}','',item.title) diff --git a/core/scrapertools.py b/core/scrapertools.py index 5b6d4bac..d303593d 100644 --- a/core/scrapertools.py +++ b/core/scrapertools.py @@ -39,9 +39,30 @@ def find_multiple_matches_groups(text, pattern): # Convierte los codigos html "ñ" y lo reemplaza por "ñ" caracter unicode utf-8 def decodeHtmlentities(data): - import HTMLParser - parser = HTMLParser.HTMLParser() - return parser.unescape(data) + entity_re = re.compile("&(#?)(\d{1,5}|\w{1,8})(;?)") + + def substitute_entity(match): + ent = match.group(2) + match.group(3) + res = "" + while not ent in html5 and not ent.endswith(";") and match.group(1) != "#": + # Excepción para cuando '&' se usa como argumento en la urls contenidas en los datos + try: + res = ent[-1] + res + ent = ent[:-1] + except: + break + + if match.group(1) == "#" and ent.replace(";", "").isdigit(): + ent = unichr(int(ent.replace(";", ""))) + return ent.encode('utf-8') + else: + cp = html5.get(ent) + if cp: + return cp.decode("unicode-escape").encode('utf-8') + res + else: + return match.group() + + return entity_re.subn(substitute_entity, data)[0] def unescape(text): diff --git a/core/support.py b/core/support.py index 6c340bd7..5da507d9 100755 --- a/core/support.py +++ b/core/support.py @@ -168,10 +168,7 @@ def scrapeLang(scraped, lang, longtitle): return language, longtitle def cleantitle(title): - try: - cleantitle = scrapertools.htmlclean(scrapertools.decodeHtmlentities(title).replace('"', "'").replace('×', 'x').replace('–', '-')).strip() - except: - cleantitle = title + cleantitle = scrapertools.htmlclean(scrapertools.decodeHtmlentities(title).replace('"', "'").replace('×', 'x').replace('–', '-')).strip() return cleantitle def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, typeContentDict, typeActionDict, blacklist, search, pag, function, lang): @@ -555,7 +552,7 @@ def dooplay_search_vars(item, blacklist): def dooplay_menu(item, type): - patron = '<a href="(?P<url>[^"#]+)"(?: title="[^"]+")?>(?P<title>[a-zA-Z0-9]+)' + patronMenu = '<a href="(?P<url>[^"#]+)"(?: title="[^"]+")?>(?P<title>[a-zA-Z0-9]+)' patronBlock = '<nav class="' + item.args + '">(?P<block>.*?)</nav>' action = 'peliculas' @@ -1048,7 +1045,7 @@ def controls(itemlist, item, AutoPlay=True, CheckLinks=True, down_load=True): channel_node = autoplay_node.get(item.channel, {}) settings_node = channel_node.get('settings', {}) AP = get_setting('autoplay') or settings_node['active'] - HS = config.get_setting('hide_servers') + HS = config.get_setting('hide_servers') or (settings_node['hide_servers'] if settings_node.has_key('hide_server') else False) if CL and not AP: if get_setting('checklinks', item.channel): diff --git a/specials/autoplay.py b/specials/autoplay.py index cff4ecf9..7a11f281 100644 --- a/specials/autoplay.py +++ b/specials/autoplay.py @@ -409,6 +409,7 @@ def init(channel, list_servers, list_quality, reset=False): "quality": list_quality, "settings": { "active": False, + "hide_servers": False, "plan_b": True, "custom_servers": False, "custom_quality": False, @@ -498,16 +499,24 @@ def autoplay_config(item): active_settings = {"id": "active", "label": config.get_localized_string(60079), "type": "bool", "default": False, "enabled": allow_option, "visible": allow_option} + list_controls.append(active_settings) dict_values['active'] = settings_node.get('active', False) + hide_servers = {"id": "hide_servers", "label": config.get_localized_string(70747), + "type": "bool", "default": False, "enabled": "eq(-1,true)", + "visible": allow_option} + + list_controls.append(hide_servers) + dict_values['hide_servers'] = settings_node.get('hide_servers', False) + # Idioma status_language = config.get_setting("filter_languages", item.from_channel) if not status_language: status_language = 0 set_language = {"id": "language", "label": config.get_localized_string(60080), - "type": "list", "default": 0, "enabled": "eq(-1,true)", "visible": True, + "type": "list", "default": 0, "enabled": "eq(-2,true)", "visible": True, "lvalues": get_languages(item.from_channel)} list_controls.append(set_language)