From 7b788c040e874ec56e9e5b557557135470cd3c25 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Thu, 26 Mar 2020 12:27:44 +0100 Subject: [PATCH 1/9] Fix divisione per stagioni Community Channels --- specials/community.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specials/community.py b/specials/community.py index bd91a2f2..79e27f16 100644 --- a/specials/community.py +++ b/specials/community.py @@ -283,7 +283,7 @@ def episodios(item, json ='', key='', itemlist =[]): ep = 1 season = infoLabels['season'] if 'season' in infoLabels else item.contentSeason if item.contentSeason else 1 - if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'search']: + if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes', 'search'] and not show_seasons: Pagination = int(defp) if defp.isdigit() else '' else: Pagination = '' pag = item.page if item.page else 1 @@ -314,7 +314,7 @@ def episodios(item, json ='', key='', itemlist =[]): title = ' - ' + option['title'] if 'title' in option else '' title = '%sx%s%s' % (season_number, episode_number, title) extra = set_extra_values(item, option, item.path) - if season_number == item.filterseason or not item.filterseason: + if season_number == int(item.filterseason) or not item.filterseason: itemlist.append(Item(channel = item.channel, title = set_title(title, extra.language, extra.quality), fulltitle = item.fulltitle, From 59664b124354a86b1b5bc7c1d51356258537a9aa Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Thu, 26 Mar 2020 12:39:48 +0100 Subject: [PATCH 2/9] ops! --- specials/community.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specials/community.py b/specials/community.py index 79e27f16..3c91da3a 100644 --- a/specials/community.py +++ b/specials/community.py @@ -314,7 +314,7 @@ def episodios(item, json ='', key='', itemlist =[]): title = ' - ' + option['title'] if 'title' in option else '' title = '%sx%s%s' % (season_number, episode_number, title) extra = set_extra_values(item, option, item.path) - if season_number == int(item.filterseason) or not item.filterseason: + if not item.filterseason or season_number == int(item.filterseason): itemlist.append(Item(channel = item.channel, title = set_title(title, extra.language, extra.quality), fulltitle = item.fulltitle, From 9a21e412fb31f5d07021d4855a2c51bac9d3d67d Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Thu, 26 Mar 2020 15:59:59 +0100 Subject: [PATCH 3/9] RaiPlay: - Nuova Sezione Learning - Ricerca per Sezione - Vari Fix --- channels/raiplay.py | 78 ++++++++++++++++++++++++++++++--------------- channelselector.py | 2 +- 2 files changed, 53 insertions(+), 27 deletions(-) diff --git a/channels/raiplay.py b/channels/raiplay.py index d685da92..91514331 100644 --- a/channels/raiplay.py +++ b/channels/raiplay.py @@ -26,6 +26,7 @@ def mainlist(item): ('Documentari {bullet bold}', ['/documentari/index.json', 'menu']), ('Programmi TV{bullet bold}', ['/programmi/index.json', 'menu']), ('Programmi per Bambini {bullet bold}', ['/bambini/index.json', 'menu']), + ('Learning {bullet bold}', ['/learning/index.json', 'learning']), ('Teche Rai {bullet bold storia}', ['/techerai/index.json', 'menu']), ('Musica e Teatro {bullet bold}', ['/performing-arts/index.json', 'menu']) ] @@ -44,11 +45,24 @@ def menu(item): url = item.url, args = 'genre', action = 'submenu'), support.Item(channel= item.channel, title = support.typo('A-Z','submenu'), - url = item.url, args = 'az', action = 'submenu')] + url = item.url, args = 'az', action = 'submenu'), + support.Item(channel= item.channel, title = support.typo('Cerca','submenu'), + url = item.url, action = 'search')] return support.thumb(itemlist) +def learning(item): + support.log() + itemlist =[] + json = current_session.get(item.url).json()['contents'] + for key in json: + support.log(key['name']) + itemlist.append(support.Item(channel = item.channel, title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'], + url = key['contents'], thumbnail = item.thumbnail, action = 'peliculas', args = item.args)) + return itemlist + + def submenu(item): support.log() itemlist = [] @@ -113,13 +127,17 @@ def search(item, text): support.log() itemlist =[] try: - json = current_session.get(host + '/dl/RaiTV/RaiPlayMobile/Prod/Config/programmiAZ-elenco.json').json() - for key in json: - for key in json[key]: - if 'PathID' in key and (text.lower() in key['name'].lower()): - itemlist.append(support.Item(channel = item.channel, title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'], url = key['PathID'].replace('/?json', '.json'), action = 'Type', - thumbnail = getUrl(key['images']['portrait'] if 'portrait' in key['images'] else key['images']['portrait43'] if 'portrait43' in key['images'] else key['images']['landscape']), - fanart = getUrl(key['images']['landscape'] if 'landscape' in key['images'] else key['images']['landscape43']))) + if item.url: + item.search = text + itemlist = peliculas(item) + else: + json = current_session.get(host + '/dl/RaiTV/RaiPlayMobile/Prod/Config/programmiAZ-elenco.json').json() + for key in json: + for key in json[key]: + if 'PathID' in key and (text.lower() in key['name'].lower()): + itemlist.append(support.Item(channel = item.channel, title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'], url = key['PathID'].replace('/?json', '.json'), action = 'Type', + thumbnail = getUrl(key['images']['portrait'] if 'portrait' in key['images'] else key['images']['portrait43'] if 'portrait43' in key['images'] else key['images']['landscape']), + fanart = getUrl(key['images']['landscape'] if 'landscape' in key['images'] else key['images']['landscape43']))) except: import sys for line in sys.exc_info(): @@ -152,17 +170,17 @@ def dirette(item): def peliculas(item): - support.log() + support.log(item.url) itemlist = [] keys = [] key_list = [] # pagination options pag = item.page if item.page else 1 - pagination = 40 + pagination = 40 if not item.search else '' # load json - if item.args == 'az': + if type(item.url) in [dict, list]: json = item.url for key in json: if item.search.lower() in key['name'].lower(): @@ -224,7 +242,8 @@ def episodios(item): if res.result(): itemlist += res.result() if itemlist and itemlist[0].VL: - itemlist.reverse() + # itemlist.reverse() + itemlist = sorted(itemlist, key=lambda it: it.order) support.videolibrary(itemlist, item) else: itemlist = sorted(itemlist, key=lambda it: it.title) @@ -274,34 +293,41 @@ def getUrl(pathId): def addinfo(key, item): support.log() info = current_session.get(getUrl(key['info_url'])).json() - it = support.Item( channel = item.channel, title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'], - thumbnail = getUrl(key['images']['portrait_logo']), fanart = getUrl(key['images']['landscape']), url = getUrl(key['path_id']), plot = info['description']) - if key['layout'] == 'single': - it.action = 'findvideos' - it.contentType = 'movie' - it.contentTitle = it.fulltitle - else: - it.action = 'select' - it.contentType = 'tvshow' - it.contentSerieName = it.fulltitle - return it + if not item.search or item.search.lower() in key['name'].lower(): + it = support.Item( channel = item.channel, title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'], + thumbnail = getUrl(key['images']['portrait_logo'] if key['images']['portrait_logo'] else key['images']['landscape']), fanart = getUrl(key['images']['landscape']), url = getUrl(key['path_id']), plot = info['description']) + if 'layout' not in key or key['layout'] == 'single': + it.action = 'findvideos' + it.contentType = 'movie' + it.contentTitle = it.fulltitle + else: + it.action = 'select' + it.contentType = 'tvshow' + it.contentSerieName = it.fulltitle + return it def load_episodes(key, item): support.log() itemlist=[] json = current_session.get(getUrl(key['path_id'])).json()['items'] + order = 0 for key in json: - ep = support.match(key['subtitle'], patron=r'St\s*(\d+)\s*Ep\s*(\d+)').match + support.log(key) + ep = support.match(key['subtitle'], patron=r'(?:St\s*(\d+))?\s*Ep\s*(\d+)').match if ep: - title = ep[0] + 'x' + ep[1].zfill(2) + support.re.sub(r'St\s*\d+\s*Ep\s*\d+','',key['subtitle']) + season = '1' if not ep[0] else ep[0] + episode = ep[1].zfill(2) + title = season + 'x' + episode + support.re.sub(r'(?:St\s*\d+)?\s*Ep\s*\d+','',key['subtitle']) + order = int(season + episode) else: title = key['subtitle'].strip() + # title = key['subtitle'].strip() if not title: title = key['name'] itemlist.append(support.Item(channel = item.channel, title = support.typo(title, 'bold'), fulltitle = item.fulltitle, show = item.show, thumbnail = item.thumbnail, fanart = getUrl(key['images']['landscape']), url = key['video_url'], plot = key['description'], contentType = 'episode', - action = 'findvideos', VL=True if ep else False)) + action = 'findvideos', VL=True if ep else False, order=order)) return itemlist diff --git a/channelselector.py b/channelselector.py index 52c174d2..45efe554 100644 --- a/channelselector.py +++ b/channelselector.py @@ -384,7 +384,7 @@ def thumb(item_or_itemlist=None, genre=False, thumb=''): import re icon_dict = {'channels_movie':['film'], 'channels_tvshow':['serie','tv','episodi','episodio','fiction'], - 'channels_documentary':['documentari','documentario', 'documentary'], + 'channels_documentary':['documentari','documentario', 'documentary', 'learning'], 'channels_all':['tutti'], 'news':['novità', "novita'", 'aggiornamenti', 'nuovi', 'nuove'], 'now_playing':['cinema', 'in sala'], From cbda25082091c7515207cc6e8e6d007d9a594874 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Thu, 26 Mar 2020 17:18:42 +0100 Subject: [PATCH 4/9] Raiplay: - Nuova Sezione Teen - Nuove Icone --- channels/raiplay.py | 1 + channelselector.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/channels/raiplay.py b/channels/raiplay.py index 91514331..01815fbd 100644 --- a/channels/raiplay.py +++ b/channels/raiplay.py @@ -26,6 +26,7 @@ def mainlist(item): ('Documentari {bullet bold}', ['/documentari/index.json', 'menu']), ('Programmi TV{bullet bold}', ['/programmi/index.json', 'menu']), ('Programmi per Bambini {bullet bold}', ['/bambini/index.json', 'menu']), + ('Teen {bullet bold}', ['/teen/index.json', 'learning']), ('Learning {bullet bold}', ['/learning/index.json', 'learning']), ('Teche Rai {bullet bold storia}', ['/techerai/index.json', 'menu']), ('Musica e Teatro {bullet bold}', ['/performing-arts/index.json', 'menu']) diff --git a/channelselector.py b/channelselector.py index 45efe554..36d3a25d 100644 --- a/channelselector.py +++ b/channelselector.py @@ -384,7 +384,9 @@ def thumb(item_or_itemlist=None, genre=False, thumb=''): import re icon_dict = {'channels_movie':['film'], 'channels_tvshow':['serie','tv','episodi','episodio','fiction'], - 'channels_documentary':['documentari','documentario', 'documentary', 'learning'], + 'channels_documentary':['documentari','documentario', 'documentary'], + 'channels_teenager':['ragazzi','teenager', 'teen'], + 'channels_learning':['learning'], 'channels_all':['tutti'], 'news':['novità', "novita'", 'aggiornamenti', 'nuovi', 'nuove'], 'now_playing':['cinema', 'in sala'], From 45639bbbe02339d228765ce21e31dad8db215c36 Mon Sep 17 00:00:00 2001 From: MaxE <29448127+EMaX0@users.noreply.github.com> Date: Sun, 22 Mar 2020 03:01:36 +0800 Subject: [PATCH 5/9] Fix AkVideo --- servers/akvideo.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/servers/akvideo.py b/servers/akvideo.py index c756cb35..3782780e 100644 --- a/servers/akvideo.py +++ b/servers/akvideo.py @@ -54,14 +54,24 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= data = block if block else data # URL # logger.info(data) - matches = scrapertools.find_multiple_matches(data, '''src:\s*["']?(http.*?\.mp4)''') - # logger.info(str(matches)) + if vres: + matches = scrapertools.find_multiple_matches(data, '''src:\s*["']?(http.*?\.mp4)''') + else: + matches = scrapertools.find_multiple_matches(data, '''src:\s*["']?(http.*?\.mp4)(?:[^,]+,[^,]+,res:([^,]+))?''') + if matches: + if len(matches[0])==2: + i=0 + for m in matches: + vres.append("%sx" % m[1]) + matches[i]=m[0] + i+=1 + _headers = urllib.urlencode(httptools.default_headers) i = 0 for media_url in matches: # URL del vídeo - video_urls.append([vres[i] + " mp4 [Akvideo] ", media_url.replace('https://', 'http://') + '|' + _headers]) + video_urls.append([vres[i] if i Date: Thu, 26 Mar 2020 22:29:42 +0100 Subject: [PATCH 6/9] Fix AltadefinizioneClick --- channels/altadefinizioneclick.py | 44 +++++++++++++++++++------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/channels/altadefinizioneclick.py b/channels/altadefinizioneclick.py index 4dc3ec50..86ae33db 100644 --- a/channels/altadefinizioneclick.py +++ b/channels/altadefinizioneclick.py @@ -37,6 +37,7 @@ 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']), @@ -50,38 +51,41 @@ def peliculas(item): support.log() patron = r'
[ ]?(?:(?P[^<>]+))?.+?'\ - 'href="(?P[^"]+)".+?src="(?P[^"]+)".+?

[^>]+>'\ - '(?P.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?'\ - '(?:IMDB\:</strong>[ ](?P<rating>.+?)<|</h2> )' - patronBlock = r'<h1 class="titleSection titleLastIns">.+?</h1>(?P<block>.*?)<div class="row ismobile">' + r'href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)".+?<h2 class="titleFilm">[^>]+>'\ + r'(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?'\ + r'(?:IMDB\:</strong>[ ](?P<rating>.+?)<|</h2> )' + if item.args in ['news', 'cinema']: + patronBlock = r'h1>(?P<block>.*?)<div class="row ismobile">' - if item.args == 'genres': + elif item.args == 'az': + patron = r'<img style="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>'\ + r'<a href="(?P<url>[^"]+)" [^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<year>\d{4})' + + elif item.args == 'genres': patron = r'<div class="wrapperImage">[ ]?(?:<span class="hd">'\ - '(?P<quality>[^<>]+))?.+?href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)"'\ - '.+?<h2 class="titleFilm(?:Mobile)?">[^>]+>(?P<title>.+?)[ ]?'\ - '(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?'\ - '(IMDB\:[ ](?P<rating>.+?))<' + r'(?P<quality>[^<>]+))?.+?href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)"'\ + r'.+?<h2 class="titleFilm(?:Mobile)?">[^>]+>(?P<title>.+?)[ ]?'\ + r'(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?'\ + r'(IMDB\:[ ](?P<rating>.+?))<' elif item.args == 'search': patronBlock = r'<section id="lastUpdate">(?P<block>.*?)<div class="row ismobile">' patron = r'<a href="(?P<url>[^"]+)">\s*<div class="wrapperImage">(?:<span class="hd">(?P<quality>[^<]+)'\ - '<\/span>)?<img[^s]+src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)<[^<]+>'\ - '(?:.*?IMDB:\s(\2[^<]+)<\/div>)?' - elif not item.args: + r'<\/span>)?<img[^s]+src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)<[^<]+>'\ + r'(?:.*?IMDB:\s(\2[^<]+)<\/div>)?' + else: patronBlock = r'ULTIMI INSERITI(?P<block>.*?)<div class="sliderLastUpdate ismobile ">' # nella pagina "CERCA", la voce "SUCCESSIVO" apre la maschera di inserimento dati patronNext = r'<a class="next page-numbers" href="([^"]+)">' - #debug = True return locals() @support.scrape def genres(item): - support.log('genres', item) - #debug = True + support.log() action = 'peliculas' - patron = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<' + 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">' @@ -93,8 +97,12 @@ def genres(item): 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' - - item.args = 'genres' + 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() From d0a0f0d37090c93764c7aa3b9b681b99fb3eb11b Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 27 Mar 2020 15:23:25 +0100 Subject: [PATCH 7/9] Fix AltadefinizioneClick --- channels/altadefinizioneclick.py | 36 ++++++++++++-------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/channels/altadefinizioneclick.py b/channels/altadefinizioneclick.py index 86ae33db..270dbab5 100644 --- a/channels/altadefinizioneclick.py +++ b/channels/altadefinizioneclick.py @@ -33,7 +33,6 @@ list_quality = ['1080p', '720p', '360p'] @support.menu def mainlist(item): - support.log() film = ['', ('Novità', ['/nuove-uscite/', 'peliculas', 'news']), ('Al Cinema', ['/al-cinema/', 'peliculas', 'cinema']), @@ -48,31 +47,24 @@ def mainlist(item): @support.scrape def peliculas(item): - support.log() + patron = r'<div class="wrapperImage">[ ]?(?:<span class="hd">(?P<quality>[^<>]+))?.+?href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)".+?<h2 class="titleFilm">[^>]+>'\ + r'(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?(?:IMDB\:</strong>[ ](?P<rating>.+?)<|</h2> )' + patronBlock = r'h1>(?P<block>.*?)<div class="row ismobile">' - patron = r'<div class="wrapperImage">[ ]?(?:<span class="hd">(?P<quality>[^<>]+))?.+?'\ - r'href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)".+?<h2 class="titleFilm">[^>]+>'\ - r'(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?'\ - r'(?:IMDB\:</strong>[ ](?P<rating>.+?)<|</h2> )' - if item.args in ['news', 'cinema']: - patronBlock = r'h1>(?P<block>.*?)<div class="row ismobile">' - - elif item.args == 'az': - patron = r'<img style="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>'\ - r'<a href="(?P<url>[^"]+)" [^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<year>\d{4})' + 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 == 'genres': - patron = r'<div class="wrapperImage">[ ]?(?:<span class="hd">'\ - r'(?P<quality>[^<>]+))?.+?href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)"'\ - r'.+?<h2 class="titleFilm(?:Mobile)?">[^>]+>(?P<title>.+?)[ ]?'\ - r'(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?'\ - r'(IMDB\:[ ](?P<rating>.+?))<' + patron = r'<div class="wrapperImage">[ ]?(?:<span class="hd">(?P<quality>[^<>]+))?.+?href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)"'\ + r'.+?<h2 class="titleFilm(?:Mobile)?">[^>]+>(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?(IMDB\:[ ](?P<rating>.+?))<' elif item.args == 'search': patronBlock = r'<section id="lastUpdate">(?P<block>.*?)<div class="row ismobile">' - patron = r'<a href="(?P<url>[^"]+)">\s*<div class="wrapperImage">(?:<span class="hd">(?P<quality>[^<]+)'\ - r'<\/span>)?<img[^s]+src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)<[^<]+>'\ - r'(?:.*?IMDB:\s(\2[^<]+)<\/div>)?' - else: + patron = r'<a href="(?P<url>[^"]+)">\s*<div class="wrapperImage">(?:<span class="hd">(?P<quality>[^<]+)<\/span>)?<img[^s]+src="(?P<thumb>[^"]+)"'\ + r'[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)<[^<]+>(?:.*?IMDB:\s(\2[^<]+)<\/div>)?' + + if not item.args: patronBlock = r'ULTIMI INSERITI(?P<block>.*?)<div class="sliderLastUpdate ismobile ">' # nella pagina "CERCA", la voce "SUCCESSIVO" apre la maschera di inserimento dati @@ -82,8 +74,6 @@ def peliculas(item): @support.scrape def genres(item): - support.log() - action = 'peliculas' patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<' From b950530a41b8fbe66c1a98363047a41bcfd9cca1 Mon Sep 17 00:00:00 2001 From: Alhaziel01 <alhaziel01@gmail.com> Date: Fri, 27 Mar 2020 10:56:22 +0100 Subject: [PATCH 8/9] Fix Raiplay --- channels/raiplay.py | 55 +++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/channels/raiplay.py b/channels/raiplay.py index 01815fbd..efe0569f 100644 --- a/channels/raiplay.py +++ b/channels/raiplay.py @@ -235,19 +235,47 @@ def select(item): def episodios(item): - support.log() + support.log(len(item.url)) itemlist = [] - with futures.ThreadPoolExecutor() as executor: - itlist = [executor.submit(load_episodes, key, item) for key in item.url] - for res in futures.as_completed(itlist): - if res.result(): - itemlist += res.result() - if itemlist and itemlist[0].VL: - # itemlist.reverse() - itemlist = sorted(itemlist, key=lambda it: it.order) - support.videolibrary(itemlist, item) + if type(item.url) in [list, dict] and len(item.url) > 1 and ('name' in item.url[0] and 'stagione' not in item.url[0]['name'].lower()): + for key in item.url: + itemlist.append(support.Item(channel = item.channel, title = support.typo(key['name'], 'bold'), fulltitle = item.fulltitle, show = item.show, thumbnail = item.thumbnail, + fanart = item.fanart, url = getUrl(key['path_id']), plot = item.plot, contentType = 'tvshow', + action = 'episodios')) + + elif type(item.url) in [list, dict]: + with futures.ThreadPoolExecutor() as executor: + itlist = [executor.submit(load_episodes, key, item) for key in item.url] + for res in futures.as_completed(itlist): + if res.result(): + itemlist += res.result() + if itemlist and itemlist[0].VL: + # itemlist.reverse() + itemlist = sorted(itemlist, key=lambda it: it.order) + support.videolibrary(itemlist, item) + else: + itemlist = sorted(itemlist, key=lambda it: it.title) + else: - itemlist = sorted(itemlist, key=lambda it: it.title) + if type(item.url) in [list, dict]: item.url = getUrl(item.url[0]['path_id']) + json = current_session.get(item.url).json()['items'] + for key in json: + ep = support.match(key['subtitle'], patron=r'(?:St\s*(\d+))?\s*Ep\s*(\d+)').match + if ep: + season = '1' if not ep[0] else ep[0] + episode = ep[1].zfill(2) + title = support.re.sub(r'(?:St\s*\d+)?\s*Ep\s*\d+','',key['subtitle']) + title = season + 'x' + episode + (' - ' + title if not title.startswith(' ') else title if title else '') + else: + title = key['subtitle'].strip() + # title = key['subtitle'].strip() + if not title: + title = key['name'] + itemlist.append(support.Item(channel = item.channel, title = support.typo(title, 'bold'), fulltitle = item.fulltitle, show = item.show, thumbnail = item.thumbnail, + fanart = getUrl(key['images']['landscape']), url = key['video_url'], plot = key['description'], contentType = 'episode', + action = 'findvideos', VL=True if ep else False)) + + if itemlist and itemlist[0].VL: support.videolibrary(itemlist, item) return itemlist @@ -310,11 +338,10 @@ def addinfo(key, item): def load_episodes(key, item): support.log() - itemlist=[] + itemlist = [] json = current_session.get(getUrl(key['path_id'])).json()['items'] order = 0 for key in json: - support.log(key) ep = support.match(key['subtitle'], patron=r'(?:St\s*(\d+))?\s*Ep\s*(\d+)').match if ep: season = '1' if not ep[0] else ep[0] @@ -323,9 +350,9 @@ def load_episodes(key, item): order = int(season + episode) else: title = key['subtitle'].strip() - # title = key['subtitle'].strip() if not title: title = key['name'] + itemlist.append(support.Item(channel = item.channel, title = support.typo(title, 'bold'), fulltitle = item.fulltitle, show = item.show, thumbnail = item.thumbnail, fanart = getUrl(key['images']['landscape']), url = key['video_url'], plot = key['description'], contentType = 'episode', action = 'findvideos', VL=True if ep else False, order=order)) From 256c76ca7b527efcbee804a53960b26b50f7ffe1 Mon Sep 17 00:00:00 2001 From: Alhaziel <alhaziel01@gmail.com> Date: Mon, 16 Mar 2020 17:37:20 +0100 Subject: [PATCH 9/9] Fix Inserisci URL --- specials/url.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/specials/url.py b/specials/url.py index c1210f48..44e73162 100644 --- a/specials/url.py +++ b/specials/url.py @@ -1,40 +1,40 @@ # -*- coding: utf-8 -*- -from core import httptools from core import servertools +from core.support import match, log from core.item import Item from platformcode import config, logger def mainlist(item): - logger.info() + log() itemlist = [] - itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60089))) - itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60090))) - itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60091))) + itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60089), thumbnail=item.thumbnail, args='server')) + itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60090), thumbnail=item.thumbnail, args='direct')) + itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60091), thumbnail=item.thumbnail)) return itemlist -# Al llamarse "search" la función, el launcher pide un texto a buscar y lo añade como parámetro -def search(item, texto): - logger.info("texto=" + texto) +# Al llamarse "search" la función, el launcher pide un text a buscar y lo añade como parámetro +def search(item, text): + log(text) - if not texto.startswith("http"): - texto = "http://" + texto + if not text.startswith("http"): + text = "http://" + text itemlist = [] - if "servidor" in item.title: - itemlist = servertools.find_video_items(data=texto) + if "server" in item.args: + itemlist = servertools.find_video_items(data=text) for item in itemlist: item.channel = "url" item.action = "play" - elif "directo" in item.title: - itemlist.append(Item(channel=item.channel, action="play", url=texto, server="directo", title=config.get_localized_string(60092))) + elif "direct" in item.args: + itemlist.append(Item(channel=item.channel, action="play", url=text, server="directo", title=config.get_localized_string(60092))) else: - data = httptools.downloadpage(texto).data + data = match(text).data itemlist = servertools.find_video_items(data=data) for item in itemlist: item.channel = "url"