From 1544f32c8ccf9801d2187879252b08cb742e17de Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 30 Sep 2021 17:45:07 +0000 Subject: [PATCH 01/11] Aggiornamento domini --- channels.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/channels.json b/channels.json index 4f0963c6..7324136c 100644 --- a/channels.json +++ b/channels.json @@ -19,16 +19,16 @@ "discoveryplus": "https://www.discoveryplus.com", "dreamsub": "https://dreamsub.stream", "dsda": "https://www.dsda.press", - "eurostreaming": "https://eurostreaming.bar", + "eurostreaming": "https://eurostreaming.red", "filmigratis": "https://filmigratis.org", "guardaseriecam": "https://guardaserie.cam", "guardaserieclick": "https://www.guardaserie.builders", - "guardaserieicu": "https://guardaserie.wales", + "guardaserieicu": "https://guardaserie.cymru", "hd4me": "https://hd4me.net", "ilcorsaronero": "https://ilcorsaronero.link", - "ilgeniodellostreaming": "https://ilgeniodellostreaming.dog", + "ilgeniodellostreaming": "https://ilgeniodellostreaming.ltd", "ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.city", - "italiaserie": "https://italiaserie.guru", + "italiaserie": "https://italiaserie.golf", "mediasetplay": "https://www.mediasetplay.mediaset.it", "mondoserietv": "https://mondoserietv.club", "paramount": "https://www.paramountnetwork.it", From 6e0cd8ff46ee7c22bf4118e62d3f878dc5c7c3d2 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Thu, 30 Sep 2021 20:27:07 +0200 Subject: [PATCH 02/11] Fix Altadefinizione Community --- channels.json | 4 ++-- channels/altadefinizionecommunity.py | 31 +++++++++++++++------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/channels.json b/channels.json index 7324136c..d0b897de 100644 --- a/channels.json +++ b/channels.json @@ -2,7 +2,6 @@ "direct": { "altadefinizione01": "https://www.altadefinizione01.plus", "altadefinizione01_link": "https://altadefinizione01.travel", - "altadefinizionecommunity": "https://altadefinizionecommunity.me", "animealtadefinizione": "https://www.animealtadefinizione.it", "animeforce": "https://www.animeforce.it", "animeleggendari": "https://animezeus.com", @@ -49,6 +48,7 @@ "altadefinizioneclick": "https://altadefinizione-nuovo.click", "animealtadefinizione": "https://www.animealtadefinizione.it", "filmpertutti": "https://filmpertuttiii.nuovo.live", - "streamingcommunity": "https://streamingcommunity-nuovo.link" + "streamingcommunity": "https://streamingcommunity-nuovo.link", + "altadefinizionecommunity": "https://altaregistrazione.net" } } \ No newline at end of file diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index a2f4543b..d196365c 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -8,12 +8,12 @@ from platformcode import config, platformtools, logger from core import scrapertools, httptools -# def findhost(url): -# return support.match(url, patron=r'Accedi').match +def findhost(url): + register_url = url + return support.match(url, patron=r'Accedi').match +host = config.get_channel_url(findhost) -host = config.get_channel_url() -register_url = 'https://altaregistrazione.net' headers = {'Referer': host, 'x-requested-with': 'XMLHttpRequest'} order = ['', 'i_piu_visti', 'i_piu_votati', 'i_piu_votati_dellultimo_mese', 'titolo_az', 'voto_imdb_piu_alto'][config.get_setting('order', 'altadefinizionecommunity')] @@ -143,18 +143,21 @@ def peliculas(item): else: action = 'episodios' if not item.page: item.page = 1 - if item.args == 'search': - page = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True) - if page.json: - data = "\n".join(page.json['data']) + try: + if item.args == 'search': + page = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True) + if page.json: + data = "\n".join(page.json['data']) + else: + data = page.data else: - data = page.data - else: - params['page'] = item.page + params['page'] = item.page - url = '{}/load-more-film?{}'.format(host, support.urlencode(params)) - json = support.httptools.downloadpage(url, headers=headers, cloudscraper=True).json - data = "\n".join(json['data']) + url = '{}/load-more-film?{}'.format(host, support.urlencode(params)) + json = support.httptools.downloadpage(url, headers=headers, cloudscraper=True).json + data = "\n".join(json['data']) + except: + data = ' ' patron = r'wrapFilm">\s*\s*(?P[0-9]{4})\s*(?:]+>[^<]+)?\s*(?P[^<]+).*?]+>.*?

(?P[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?' # paginazione From 8afa165501aadefb9e67060fd6f1ea02de2783bc Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Thu, 30 Sep 2021 20:31:21 +0200 Subject: [PATCH 03/11] ops --- channels/altadefinizionecommunity.py | 1 + 1 file changed, 1 insertion(+) diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index d196365c..ff1978a9 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -9,6 +9,7 @@ from core import scrapertools, httptools def findhost(url): + global register_url register_url = url return support.match(url, patron=r'<a href="([^"]+)/\w+">Accedi').match From a5ba79d176960c19c5971d7dc8efe9f61bbdaa88 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 1 Oct 2021 09:52:17 +0200 Subject: [PATCH 04/11] - Fix Altadefinizione Community - Fix HDMario - Fix Streamtape --- channels/altadefinizionecommunity.py | 7 ++++--- servers/hdmario.py | 4 ++-- servers/streamtape.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index ff1978a9..5b20ce99 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -49,7 +49,7 @@ def mainlist(item): def login(): r = support.httptools.downloadpage(host, cloudscraper=True) Token = support.match(r.data, patron=r'name=\s*"_token"\s*value=\s*"([^"]+)', cloudscraper=True).match - if 'id="logged"' in r.text: + if 'id="logged"' in r.data: logger.info('Già loggato') else: logger.info('Login in corso') @@ -59,11 +59,11 @@ def login(): 'password':config.get_setting('password', channel='altadefinizionecommunity')} r = support.httptools.downloadpage(host + '/login', post=post, headers={'referer': host}, cloudscraper=True) - if not r.status_code in [200, 302] or 'Email o Password non validi' in r.text: + if not r.status_code in [200, 302] or 'Email o Password non validi' in r.data: platformtools.dialog_ok('AltadefinizioneCommunity', 'Username/password non validi') return False - return 'id="logged"' in r.text + return 'id="logged"' in r.data def registerOrLogin(): @@ -259,6 +259,7 @@ def play(item): def resolve_url(item): + registerOrLogin() if '/watch-unsubscribed' not in item.url and '/watch-external' not in item.url: playWindow = support.match(support.httptools.downloadpage(item.url, cloudscraper=True).data, patron='playWindow" href="([^"]+)') video_url = playWindow.match diff --git a/servers/hdmario.py b/servers/hdmario.py index 10be4d95..7edda32a 100644 --- a/servers/hdmario.py +++ b/servers/hdmario.py @@ -130,9 +130,9 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= page = httptools.downloadpage(page_url) data = page.data - logger.debug(data) + # logger.debug(data) from lib import jsunpack_js2py - unpacked = jsunpack_js2py.unpack(scrapertools.find_single_match(data, '<script type="text/javascript">\n*\s*\n*(eval.*)')) + unpacked = jsunpack_js2py.unpack(scrapertools.find_single_match(data, '(eval.*?)</')) # p,a,c,k,e,d data -> xhr.setRequestHeader secureProof = scrapertools.find_single_match(unpacked, """X-Secure-Proof['"]\s*,\s*['"]([^"']+)""") logger.debug('X-Secure-Proof=' + secureProof) diff --git a/servers/streamtape.py b/servers/streamtape.py index 3e31bc98..1ec57d35 100644 --- a/servers/streamtape.py +++ b/servers/streamtape.py @@ -21,7 +21,7 @@ def test_video_exists(page_url): page = httptools.downloadpage(page_url, headers=referer) data = page.data - if "Video not found" in data or page.code >= 400: + if "Video not found" in data or page.code >= 400 or 'Streamtape - Error' in data: return False, config.get_localized_string(70449) % 'Streamtape' return True, "" From 3ca7707c01971e68c8d079d48de54a5913d6d25c Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 1 Oct 2021 14:55:21 +0200 Subject: [PATCH 05/11] Fix Gestione Viste --- platformcode/platformtools.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index d2b385d6..87c59e28 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -378,7 +378,11 @@ def render_items(itemlist, parent_item): set_view_mode(itemlist[0], parent_item) - xbmcplugin.endOfDirectory(_handle, succeeded=True, updateListing=False, cacheToDisc=False) + cacheToDisc = False + if (parent_item.action == 'findvideos' and config.get_setting('autoplay')) or parent_item.action == 'search': + cacheToDisc = True + + xbmcplugin.endOfDirectory(_handle, succeeded=True, updateListing=False, cacheToDisc=cacheToDisc) logger.debug('END render_items') From 1efe6595e1b0ca423c0f297690c5194df3c976bb Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 1 Oct 2021 15:49:14 +0200 Subject: [PATCH 06/11] Fix Altadefinizione Click --- channels/altadefinizioneclick.py | 273 +++++++++++++------------------ 1 file changed, 114 insertions(+), 159 deletions(-) diff --git a/channels/altadefinizioneclick.py b/channels/altadefinizioneclick.py index a0aaced3..61c6dfd7 100644 --- a/channels/altadefinizioneclick.py +++ b/channels/altadefinizioneclick.py @@ -1,107 +1,42 @@ # -*- coding: utf-8 -*- # ------------------------------------------------------------ -# Canale per altadefinizioneclick +# Canale per Altadefinizione Click # ---------------------------------------------------------- -""" - Eccezioni che non superano il test del canale: - - indicare le eccezioni - - Novità. Indicare in quale/i sezione/i è presente il canale: - - film - - Avvisi: - - Eventuali avvisi per i tester - - Ulteriori info: - - -""" -from platformcode.logger import debug from core import support -from core.item import Item -from platformcode import config +from platformcode import config, logger def findhost(url): - data = support.httptools.downloadpage(url).data - host = support.scrapertools.find_single_match(data, '<div class="elementor-button-wrapper">\s*<a href="([^"]+)"') - return host + return support.match(url, patron=r'<div class="elementor-button-wrapper">\s*<a href="([^"]+)"').match host = config.get_channel_url(findhost) -headers = [['Referer', host]] +if host.endswith('/'): + host = host[:-1] +headers = {'Referer': host, 'x-requested-with': 'XMLHttpRequest'} +order = ['', 'i_piu_visti', 'i_piu_votati', 'i_piu_votati_dellultimo_mese', 'titolo_az', 'voto_imdb_piu_alto'][config.get_setting('order', 'altadefinizionecommunity')] @support.menu def mainlist(item): - film = ['', - ('Novità', ['/nuove-uscite/', 'peliculas', 'news']), - ('Al Cinema', ['/al-cinema/', 'peliculas', 'cinema']), - ('A-Z',['/lista-film/', 'genres', 'az']), - ('Generi', ['', 'genres', 'genres']), - ('Anni', ['', 'genres', 'years']), - ('Qualità', ['', 'genres', 'quality']), - ('Mi sento Fortunato',[ '', 'genres', 'lucky']), - ('Sub-ITA', ['/sub-ita/', 'peliculas', 'sub']) - ] + logger.debug(item) - tvshow = ['/serie-tv/'] + film = ['/type/movie', + ('Generi', ['/type/movie', 'genres', 'genres']), + ('Anni', ['/type/movie', 'genres', 'year']),] - search = '' + tvshow = ['/serie-tv/tvshow', + ('Generi', ['/serie-tv/tvshow', 'genres', 'genres']), + ('Anni', ['/serie-tv/tvshow', 'genres', 'year'])] + + advanced = [('Ricerca Avanzata', ['', 'advanced_search'])] return locals() -@support.scrape -def peliculas(item): - action = 'check' - - patron = r'<div class="wrapperImage">\s*(?:<span class="year">(?P<year>[^<]+)[^>]+>)?(?:<span class="hd">(?P<quality>[^<>]+))?.+?href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)".+?<h2 class="titleFilm">[^>]+>(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?</a>.*?(?:IMDB\:</strong>[ ](?P<rating>.+?)<|</div>)' - - if item.args == 'az': - patron = r'<img style="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><a href="(?P<url>[^"]+)" [^>]+>(?P<title>[^<\[]+)(?:\[(?P<lang>[^\]]+)\]\s*)?<'\ - r'[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<year>\d{4})[^>]+>[^>]+>\s*(?P<quality>[^<]+).*?<span class="label">(?P<ratting>[^<]+)<' - patronBlock ='' - - elif item.args == 'search': - patronBlock = r'<section id="lastUpdate">(?P<block>.*?)(?:<div class="row ismobile">|<section)' - patron = r'<a href="(?P<url>[^"]+)">\s*<div class="wrapperImage">(?:\s*<span class="year">(?P<year>[^<]+)<\/span>)?(?:\s*<span class="hd">(?P<quality>[^<]+)<\/span>)?[^>]+>\s*<img[^s]+src="(?P<thumb>[^"]+)"(?:(?:[^>]+>){5}\s*(?P<rating>[^<]+))?(?:[^>]+>){4}(?P<title>[^<]+)' - - if not item.args: - # patronBlock = r'(?:ULTIMI INSERITI|Serie TV)(?P<block>.*?)</section' - patronBlock = r'({})(?P<block>.*?)</section'.format('ULTIMI INSERITI' if item.contentType == 'movie' else 'Serie TV') - - # nella pagina "CERCA", la voce "SUCCESSIVO" apre la maschera di inserimento dati - patronNext = r'<a class="next page-numbers" href="([^"]+)">' - - return locals() - -@support.scrape -def genres(item): - action = 'peliculas' - patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<' - - if item.args == 'genres': - patronBlock = r'<ul class="listSubCat" id="Film">(?P<block>.*)<ul class="listSubCat" id="Anno">' - elif item.args == 'years': - patronBlock = r'<ul class="listSubCat" id="Anno">(?P<block>.*)<ul class="listSubCat" id="Qualita">' - elif item.args == 'quality': - patronBlock = r'<ul class="listSubCat" id="Qualita">(?P<block>.*)</li>\s*?</ul>\s*?</div>\s*?</div>\s*?</div>\s*?<a' - elif item.args == 'lucky': # sono i titoli random nella pagina - patronBlock = r'<h3 class="titleSidebox dado">FILM RANDOM</h3>(?P<block>.*)</section>' - patron = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<[]+)(?:\[(?P<lang>.+?)\])?<' - action = 'findvideos' - elif item.args == 'az': - blacklist = ['FILM 4K IN STREAMING'] - patron = r'<a title="(?P<title>[^"]+)" href="(?P<url>[^"]+)"' - item.args = 'az' - if not item.args == 'az': - item.args = 'genres' - - return locals() def search(item, texto): - support.info("search ", texto) + logger.debug("search ", texto) item.args = 'search' - item.url = host + "?s=" + texto + item.url = host + "/search?s={}&f={}&page=1".format(texto, item.contentType) try: return peliculas(item) # Continua la ricerca in caso di errore @@ -111,87 +46,107 @@ def search(item, texto): support.logger.error("%s" % line) return [] -def newest(categoria): - support.info(categoria) - itemlist = [] - item = Item() - try: - if categoria == "peliculas": - item.args = 'news' - item.contentType = 'movie' - item.url = host + "/nuove-uscite/" - item.action = "peliculas" - itemlist = peliculas(item) - - if itemlist[-1].action == "peliculas": - itemlist.pop() - - # Continua la ricerca in caso di errore - except: - import sys - for line in sys.exc_info(): - from platformcode import logger - logger.error("{0}".format(line)) - return [] - - return itemlist - - -def check(item): - item.contentType = 'tvshow' - def get_season(pageData, seas_url, season): - data = '' - episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches - for episode_url, episode in episodes: - # episode_url = support.urlparse.urljoin(item.url, episode_url) - # if '-' in episode: episode = episode.split('-')[0].zfill(2) + 'x' + episode.split('-')[1].zfill(2) - title = season + "x" + episode.zfill(2) + ' - ' + item.fulltitle - data += title + '|' + episode_url + '\n' - return data - - patron_season = '<div class="[^"]+" id="seasonsModal"[^>]+>(.*?)</ul>' - patron_episode = '<div class="[^"]+" id="episodesModal"[^>]+>(.*?)</ul>' - patron_option = r'<a href="([^"]+?)".*?>(?:Stagione |Episodio )([^<]+?)</a>' - - url = support.match(item, patron=r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen').match - seasons = support.match(url, patronBlock=patron_season, patron=patron_option) - if not seasons.match: - item.contentType = 'movie' - return findvideos(item) - - data = '' - - import sys - if sys.version_info[0] >= 3: from concurrent import futures - else: from concurrent_py2 import futures - with futures.ThreadPoolExecutor() as executor: - thL = [] - for i, season in enumerate(seasons.matches): - thL.append(executor.submit(get_season, seasons.data if i == 0 else '', season[0], season[1])) - for res in futures.as_completed(thL): - if res.result(): - data += res.result() - item.data = data - return episodios(item) @support.scrape -def episodios(item): - data = item.data +def genres(item): + logger.debug(item) + data = support.httptools.downloadpage(item.url, cloudscraper=True).data + blacklist= ['Film', 'Serie TV'] - patron = r'(?P<season>\d+)x(?P<episode>\d+)\s*-\s*(?P<title>[^\|]+)\|(?P<url>[^ ]+)' - action = 'findvideos' + if item.args == 'genres': + categories ={} + res = support.match(host + '/cerca', patron=r'for="cat-(\d+)[^>]+>([^<]+)').matches + for _id, name in res: + categories[name] = _id - def itemlistHook(itemlist): - itemlist.sort(key=lambda item: (item.infoLabels['season'], item.infoLabels['episode'])) - return itemlist + patronBlock = r'{}<span></span>(?P<block>.*?)</ul>\s*</li'.format('Film' if item.contentType == 'movie' else 'Serie TV') + patronMenu = r'<a href="[^"]+">(?P<title>[^<]+)' + + def itemHook(it): + it.cat_id = categories[it.fulltitle] + return it + + if item.args == 'year': + patron = r'value="(?P<year_id>[^"]+)"[^>]*>(?P<title>\d+)' + patronBlock = r'Anno</option>(?P<block>.*?</select>)' + + elif item.args == 'quality': + patronMenu = r'quality/(?P<quality_id>[^"]+)">(?P<title>[^<]+)' + patronBlock = r'Risoluzione(?P<block>.*?)</ul>' + action = 'peliculas' + return locals() + + +@support.scrape +def peliculas(item): + item.quality = 'HD' + json = {} + params ={'type':item.contentType, 'anno':item.year_id, 'quality':item.quality_id, 'cat':item.cat_id, 'order':order} + + + if item.contentType == 'movie': + action = 'findvideos' + else: + action = 'episodios' + if not item.page: item.page = 1 + try: + # support.dbg() + if item.args in ['search']: + page = support.httptools.downloadpage(item.url, headers=headers) + if page.json: + data = "\n".join(page.json['data']) + else: + data = page.data + else: + params['page'] = item.page + + url = '{}/load-more-film?{}'.format(host, support.urlencode(params)) + json = support.httptools.downloadpage(url, headers=headers).json + data = "\n".join(json['data']) + except: + data = ' ' + + patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">[^>]+>(?P<year>\d+)(?:[^>]+>){2}(?P<rating>[^<]+)(?:[^>]+>){4}\s*<img src="(?P<thumb>[^"]+)(?:[^>]+>){3}(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?' + # patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">[^>]+>(?P<year>\d+)(?:[^>]+>){2}(?P<rating>[^<]+)(?:[^>]+>){2}(?P<quality>[^<]+)(?:[^>]+>){2}\s*<img src="(?P<thumb>[^"]+)(?:[^>]+>){3}(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?' + + # paginazione + if json.get('have_next') or 'have_next_film=true' in data: + def fullItemlistHook(itemlist): + cat_id = support.match(data, patron=r''''cat':"(\d+)"''').match + if cat_id: item.cat_id = cat_id + item.page += 1 + support.nextPage(itemlist, item, function_or_level='peliculas') + return itemlist return locals() -def findvideos(item): - support.info('findvideos', item) - return support.hdpass_get_servers(item) -# def play(item): -# if 'hdpass' in item.url: -# return support.hdpass_get_url(item) -# return [item] +@support.scrape +def episodios(item): + logger.debug(item) + # debug = True + data = item.data + patron = r'class="playtvshow "\s+data-href="(?P<url>[^"]+)' + + def itemHook(it): + spl = it.url.split('/')[-2:] + it.infoLabels['season'] = int(spl[0])+1 + it.infoLabels['episode'] = int(spl[1])+1 + it.url = it.url.replace('/watch-unsubscribed', '/watch-external') + it.title = '{}x{:02d} - {}'.format(it.contentSeason, it.contentEpisodeNumber, it.fulltitle) + return it + + return locals() + + +def findvideos(item): + itemlist = [] + playWindow = support.match(item, patron='(?:playWindow|iframe)" (?:href|src)="([^"]+)').match + if host in playWindow: + url = support.match(playWindow, patron='allowfullscreen[^<]+src="([^"]+)"').match + else: + url = playWindow + itemlist.append(item.clone(action='play', url=url, quality='')) + + + return support.server(item, itemlist=itemlist) From 42f10a56d3535585e327ad12768afd7196091df4 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 1 Oct 2021 15:49:32 +0200 Subject: [PATCH 07/11] Fix Altadefiniziona Community --- channels/altadefinizionecommunity.py | 295 +++++++++++++-------------- 1 file changed, 143 insertions(+), 152 deletions(-) diff --git a/channels/altadefinizionecommunity.py b/channels/altadefinizionecommunity.py index 5b20ce99..49740139 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -24,28 +24,155 @@ def mainlist(item): logger.debug(item) film = ['/type/movie', - # Voce Menu,['url','action','args',contentType] - ('Generi', ['/type/movie', 'genres', 'genres']), - ('Anni', ['/type/movie', 'genres', 'year']), - # ('Qualità', ['', 'genres', 'quality']), - ] + ('Generi', ['/type/movie', 'genres', 'genres']), + ('Anni', ['/type/movie', 'genres', 'year']),] tvshow = ['/serie-tv/tvshow', - # Voce Menu,['url','action','args',contentType] - ('Generi', ['/serie-tv/tvshow', 'genres', 'genres']), - ('Anni', ['/serie-tv/tvshow', 'genres', 'year']), - # ('Qualità', ['', 'genres', 'quality']), - ] - - # altri = [ - # # ('A-Z', ['/lista-film', 'genres', 'letters']), - # ('Qualità', ['', 'genres', 'quality']), - # ('Anni', ['/anno', 'genres', 'years']) - # ] + ('Generi', ['/serie-tv/tvshow', 'genres', 'genres']), + ('Anni', ['/serie-tv/tvshow', 'genres', 'year'])] return locals() +def search(item, text): + logger.debug("search ", text) + + item.args = 'search' + item.url = host + "/search?s={}&f={}&page=1".format(text, item.contentType) + try: + return peliculas(item) + + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + support.logger.error("%s" % line) + return [] + + +@support.scrape +def genres(item): + logger.debug(item) + data = support.httptools.downloadpage(item.url).data + blacklist= ['Film', 'Serie TV'] + + if item.args == 'genres': + categories ={} + res = support.match(host + '/cerca', patron=r'for="cat-(\d+)[^>]+>([^<]+)').matches + for _id, name in res: + categories[name] = _id + + patronBlock = r'{}<span></span>(?P<block>.*?)</ul>\s*</li'.format('Film' if item.contentType == 'movie' else 'Serie TV') + patronMenu = r'<a href="[^"]+">(?P<title>[^<]+)' + + def itemHook(it): + it.cat_id = categories[it.fulltitle] + return it + + if item.args == 'year': + patron = r'value="(?P<year_id>[^"]+)"[^>]*>(?P<title>\d+)' + patronBlock = r'Anno</option>(?P<block>.*?</select>)' + + elif item.args == 'quality': + patronMenu = r'quality/(?P<quality_id>[^"]+)">(?P<title>[^<]+)' + patronBlock = r'Risoluzione(?P<block>.*?)</ul>' + + action = 'peliculas' + return locals() + + +@support.scrape +def peliculas(item): + item.quality = 'HD' + json = {} + params ={'type':item.contentType, 'anno':item.year_id, 'quality':item.quality_id, 'cat':item.cat_id, 'order':order} + + + if item.contentType == 'movie': + action = 'findvideos' + else: + action = 'episodios' + if not item.page: item.page = 1 + try: + # support.dbg() + if item.args in ['search']: + page = support.httptools.downloadpage(item.url, headers=headers) + if page.json: + data = "\n".join(page.json['data']) + else: + data = page.data + else: + params['page'] = item.page + + url = '{}/load-more-film?{}'.format(host, support.urlencode(params)) + json = support.httptools.downloadpage(url, headers=headers).json + data = "\n".join(json['data']) + except: + data = ' ' + + patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">[^>]+>(?P<year>\d+)(?:[^>]+>){2}(?P<rating>[^<]+)(?:[^>]+>){4}\s*<img src="(?P<thumb>[^"]+)(?:[^>]+>){3}(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?' + # patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">[^>]+>(?P<year>\d+)(?:[^>]+>){2}(?P<rating>[^<]+)(?:[^>]+>){2}(?P<quality>[^<]+)(?:[^>]+>){2}\s*<img src="(?P<thumb>[^"]+)(?:[^>]+>){3}(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?' + + # paginazione + if json.get('have_next') or 'have_next_film=true' in data: + def fullItemlistHook(itemlist): + cat_id = support.match(data, patron=r''''cat':"(\d+)"''').match + if cat_id: item.cat_id = cat_id + item.page += 1 + support.nextPage(itemlist, item, function_or_level='peliculas') + return itemlist + + return locals() + + +@support.scrape +def episodios(item): + logger.debug(item) + # debug = True + data = item.data + patron = r'class="playtvshow "\s+data-href="(?P<url>[^"]+)' + + def itemHook(it): + spl = it.url.split('/')[-2:] + it.infoLabels['season'] = int(spl[0])+1 + it.infoLabels['episode'] = int(spl[1])+1 + it.url = it.url.replace('/watch-unsubscribed', '/watch-external') + it.title = '{}x{:02d} - {}'.format(it.contentSeason, it.contentEpisodeNumber, it.fulltitle) + return it + + return locals() + + +def findvideos(item): + itemlist = [] + resolve_url(item) + + itemlist.append(item.clone(action='play', url=support.match(item.url, patron='allowfullscreen[^<]+src="([^"]+)"', cloudscraper=True).match, quality='')) + + return support.server(item, itemlist=itemlist) + + +def play(item): + if host in item.url: # intercetto il server proprietario + if registerOrLogin(): + return support.get_jwplayer_mediaurl(support.httptools.downloadpage(item.url, cloudscraper=True).data, 'Diretto') + else: + platformtools.play_canceled = True + return [] + else: + return [item] + + +def resolve_url(item): + registerOrLogin() + if '/watch-unsubscribed' not in item.url and '/watch-external' not in item.url: + playWindow = support.match(support.httptools.downloadpage(item.url, cloudscraper=True).data, patron='playWindow" href="([^"]+)') + video_url = playWindow.match + item.data = playWindow.data + item.url = video_url.replace('/watch-unsubscribed', '/watch-external') + return item + + def login(): r = support.httptools.downloadpage(host, cloudscraper=True) Token = support.match(r.data, patron=r'name=\s*"_token"\s*value=\s*"([^"]+)', cloudscraper=True).match @@ -130,139 +257,3 @@ def registerOrLogin(): return False return True - - -@support.scrape -def peliculas(item): - json = {} - params ={'type':item.contentType, 'anno':item.year_id, 'quality':item.quality_id, 'order':order} - - # if item.contentType == 'undefined': - # action = 'check' - if item.contentType == 'movie': - action = 'findvideos' - else: - action = 'episodios' - if not item.page: item.page = 1 - try: - if item.args == 'search': - page = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True) - if page.json: - data = "\n".join(page.json['data']) - else: - data = page.data - else: - params['page'] = item.page - - url = '{}/load-more-film?{}'.format(host, support.urlencode(params)) - json = support.httptools.downloadpage(url, headers=headers, cloudscraper=True).json - data = "\n".join(json['data']) - except: - data = ' ' - - patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">\s*<span class="year">(?P<year>[0-9]{4})</span>\s*(?:<span[^>]+>[^<]+</span>)?\s*<span class="qual">(?P<quality>[^<]+).*?<img src="(?P<thumbnail>[^"]+)[^>]+>.*?<h3>(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?' - # paginazione - if json.get('have_next'): - def fullItemlistHook(itemlist): - item.page += 1 - support.nextPage(itemlist, item, function_or_level='peliculas') - return itemlist - - return locals() - - -def search(item, texto): - logger.debug("search ", texto) - - item.args = 'search' - item.url = host + "/search?s={}&f={}&page=1".format(texto, item.contentType) - try: - return peliculas(item) - # Continua la ricerca in caso di errore - except: - import sys - for line in sys.exc_info(): - support.logger.error("%s" % line) - return [] - - -@support.scrape -def genres(item): - logger.debug(item) - data = support.httptools.downloadpage(item.url, cloudscraper=True).data - blacklist= ['Film', 'Serie TV'] - - patronBlock = r'{}<span></span>(?P<block>.*?)</ul>\s*</li'.format('Film' if item.contentType == 'movie' else 'Serie TV') - patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)' - - if item.args == 'year': - patron = r'value="(?P<year_id>[^"]+)">(?P<title>\d+)' - patronBlock = r'Anno</option>(?P<block>.*?</select>)' - elif item.args == 'quality': - patronMenu = r'quality/(?P<quality_id>[^"]+)">(?P<title>[^<]+)' - patronBlock = r'Risoluzione(?P<block>.*?)</ul>' - # elif item.args == 'years': - # item.contentType = 'undefined' - # patronBlock = r'ANNO(?P<block>.*?</section>)' - # else: - # patronBlock = ('Film' if item.contentType == 'movie' else 'Serie TV') + r'<span></span></a>\s+<ul class="dropdown-menu(?P<block>.*?)active-parent-menu' - action = 'peliculas' - return locals() - - -@support.scrape -def episodios(item): - logger.debug(item) - # debug = True - data = item.data - patron = r'class="playtvshow "\s+data-href="(?P<url>[^"]+)' - - def itemHook(it): - spl = it.url.split('/')[-2:] - it.infoLabels['season'] = int(spl[0])+1 - it.infoLabels['episode'] = int(spl[1])+1 - it.url = it.url.replace('/watch-unsubscribed', '/watch-external') - it.title = '{}x{:02d} - {}'.format(it.contentSeason, it.contentEpisodeNumber, it.fulltitle) - return it - - return locals() - - -# def check(item): -# resolve_url(item) -# if '/tvshow' in item.url: -# item.contentType = 'tvshow' -# return episodios(item) -# else: -# item.contentType = 'movie' -# return findvideos(item) - - -def findvideos(item): - itemlist = [] - resolve_url(item) - - itemlist.append(item.clone(action='play', url=support.match(item.url, patron='allowfullscreen[^<]+src="([^"]+)"', cloudscraper=True).match, quality='')) - - return support.server(item, itemlist=itemlist) - - -def play(item): - if host in item.url: # intercetto il server proprietario - if registerOrLogin(): - return support.get_jwplayer_mediaurl(support.httptools.downloadpage(item.url, cloudscraper=True).data, 'Diretto') - else: - platformtools.play_canceled = True - return [] - else: - return [item] - - -def resolve_url(item): - registerOrLogin() - if '/watch-unsubscribed' not in item.url and '/watch-external' not in item.url: - playWindow = support.match(support.httptools.downloadpage(item.url, cloudscraper=True).data, patron='playWindow" href="([^"]+)') - video_url = playWindow.match - item.data = playWindow.data - item.url = video_url.replace('/watch-unsubscribed', '/watch-external') - return item From 63ba9952228b136c8358305588942c6abce9a6f9 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 1 Oct 2021 19:27:53 +0200 Subject: [PATCH 08/11] Rimossa voce ricerca Avanzata da Altadefinizione Click --- channels/altadefinizioneclick.py | 1 - 1 file changed, 1 deletion(-) diff --git a/channels/altadefinizioneclick.py b/channels/altadefinizioneclick.py index 61c6dfd7..af1b03dd 100644 --- a/channels/altadefinizioneclick.py +++ b/channels/altadefinizioneclick.py @@ -28,7 +28,6 @@ def mainlist(item): ('Generi', ['/serie-tv/tvshow', 'genres', 'genres']), ('Anni', ['/serie-tv/tvshow', 'genres', 'year'])] - advanced = [('Ricerca Avanzata', ['', 'advanced_search'])] return locals() From 9977c2aa3cdf1e28da72fbf016b307d9ffa0e9d3 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 1 Oct 2021 19:34:11 +0200 Subject: [PATCH 09/11] Fix TMDB --- core/tmdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tmdb.py b/core/tmdb.py index 30f50302..b94acff1 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -938,7 +938,7 @@ class Tmdb(object): result = cls.get_json(url) if not isinstance(result, dict): result = ast.literal_eval(result.decode('utf-8')) - list_genres = result["genres"] + list_genres = result.get("genres", {}) for i in list_genres: cls.dic_genres[language][search_type][str(i["id"])] = i["name"] From 974a5814284140e9757f53535f281a0bf60a0d9b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com> Date: Fri, 1 Oct 2021 17:43:48 +0000 Subject: [PATCH 10/11] Aggiornamento domini --- channels.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/channels.json b/channels.json index d0b897de..3f78cb2a 100644 --- a/channels.json +++ b/channels.json @@ -13,7 +13,7 @@ "casacinema": "https://www.casacinema.page", "cb01anime": "https://www.cineblog01.red", "cineblog01": "https://cb01.uno", - "cinemalibero": "https://cinemalibero.rocks", + "cinemalibero": "https://cinemalibero.digital", "cinetecadibologna": "http://cinestore.cinetecadibologna.it", "discoveryplus": "https://www.discoveryplus.com", "dreamsub": "https://dreamsub.stream", @@ -46,9 +46,9 @@ }, "findhost": { "altadefinizioneclick": "https://altadefinizione-nuovo.click", + "altadefinizionecommunity": "https://altaregistrazione.net", "animealtadefinizione": "https://www.animealtadefinizione.it", "filmpertutti": "https://filmpertuttiii.nuovo.live", - "streamingcommunity": "https://streamingcommunity-nuovo.link", - "altadefinizionecommunity": "https://altaregistrazione.net" + "streamingcommunity": "https://streamingcommunity-nuovo.link" } } \ No newline at end of file From bd242f48750cb54d462f946657fa57e59767c233 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 1 Oct 2021 19:45:11 +0200 Subject: [PATCH 11/11] Ripristiono Vista Touch --- platformcode/platformtools.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index 87c59e28..590c2e10 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -420,11 +420,13 @@ def getCurrentView(item=None, parent_item=None): item = Item().fromurl(info) if info else Item() parent_actions = ['peliculas', 'novedades', 'search', 'get_from_temp', 'newest', 'discover_list', 'new_search', 'channel_search'] + addons = 'addons' if config.get_setting('touch_view') else '' + if parent_item.action == 'findvideos' or (parent_item.action in ['channel_search', 'new_search'] and parent_item.infoLabels['tmdb_id']): - return 'server', 'addons' if config.get_setting('touch_view') else '' + return 'server', addons elif parent_item.action == 'mainlist': - return 'channel', 'addons' if config.get_setting('touch_view') else '' + return 'channel', addons elif (item.contentType in ['movie'] and parent_item.action in parent_actions) \ or (item.channel in ['videolibrary'] and parent_item.action in ['list_movies']) \ @@ -443,13 +445,13 @@ def getCurrentView(item=None, parent_item=None): return 'episode', 'tvshows' elif parent_item.action in ['getmainlist', '']: - return 'home', 'addons' + return 'home', addons elif parent_item.action in ['filterchannels']: - return 'channels', 'addons' + return 'channels', addons else: - return 'menu', 'addons' if config.get_setting('touch_view') else '' + return 'menu', addons def set_view_mode(item, parent_item):