From 1d2ecb05d3cb7017b334b10fb02d3c087a75e4d2 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Thu, 30 Sep 2021 20:27:07 +0200 Subject: [PATCH] Fix Altadefinizione Community --- channels.json | 4 ++-- channels/altadefinizionecommunity.py | 32 ++++++++++++++++------------ 2 files changed, 20 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..ff1978a9 100644 --- a/channels/altadefinizionecommunity.py +++ b/channels/altadefinizionecommunity.py @@ -8,12 +8,13 @@ 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): + global register_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 +144,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