From 7932613f76d388da924bae07f3b398449dcec7ac Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Wed, 13 Jan 2021 17:03:12 +0100 Subject: [PATCH] Fix Server Bloccati --- core/support.py | 5 ++++- specials/community.py | 21 ++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/core/support.py b/core/support.py index 4bc5a061..91fca020 100755 --- a/core/support.py +++ b/core/support.py @@ -1155,8 +1155,11 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru verifiedItemlist = [] def getItem(videoitem): + if not videoitem.server: + s = servertools.get_server_from_url(videoitem.url) + videoitem.server = s[2] if s else 'directo' srv_param = servertools.get_server_parameters(videoitem.server.lower()) - if srv_param['active']: + if srv_param.get('active', False): if not srv_param: # do not exists or it's empty findS = servertools.get_server_from_url(videoitem.url) info(findS) diff --git a/specials/community.py b/specials/community.py index 1dca0fb1..3868be6f 100644 --- a/specials/community.py +++ b/specials/community.py @@ -402,8 +402,8 @@ def findvideos(item): json = item.url for option in json: extra = set_extra_values(item, option, item.path) - title = item.fulltitle + (' - '+option['title'] if 'title' in option else '') - title = set_title(title, extra.language, extra.quality) + title = item.fulltitle + (' - '+ option['title'] if 'title' in option else '') + title = set_title(title, extra.language, extra.quality, False) itemlist.append(Item(channel=item.channel, title=title, url=option['url'], action='play', quality=extra.quality, language=extra.language, infoLabels = item.infoLabels)) @@ -711,22 +711,25 @@ def set_extra_values(item, json, path): # format titles -def set_title(title, language='', quality=''): +def set_title(title, language='', quality='', Bold = True): logger.debug() t = support.match(title, patron=r'\{([^\}]+)\}').match - if 'bold' not in t: t += ' bold' - title = re.sub(r'(\{[^\}]+\})','',title) - title = support.typo(title,t) + bold = '' + if Bold: + bold = ' bold' + if 'bold' not in t: t += ' bold' + title = re.sub(r'(\{[^\}]+\})','',title) + title = support.typo(title,t) if quality: - title += support.typo(quality, '_ [] color kod bold') + title += support.typo(quality, '_ [] color kod' + bold) if language: if not isinstance(language, list): - title += support.typo(language.upper(), '_ [] color kod bold') + title += support.typo(language.upper(), '_ [] color kod' + bold) else: for lang in language: - title += support.typo(lang.upper(), '_ [] color kod bold') + title += support.typo(lang.upper(), '_ [] color kod' + bold) return title