Fix Community Channels
This commit is contained in:
@@ -351,93 +351,97 @@ def auto_filter(auto_lang=False):
|
|||||||
# return lang, lang_list
|
# return lang, lang_list
|
||||||
|
|
||||||
|
|
||||||
def thumb(itemlist=[], genre=False, thumb=''):
|
def thumb(item_or_itemlist=None, genre=False, thumb=''):
|
||||||
if itemlist:
|
import re
|
||||||
import re
|
icon_dict = {'channels_movie':['film'],
|
||||||
|
'channels_tvshow':['serie','tv','episodi','episodio','fiction'],
|
||||||
|
'channels_documentary':['documentari','documentario', 'documentary'],
|
||||||
|
'channels_all':['tutti'],
|
||||||
|
'news':['novità', "novita'", 'aggiornamenti', 'nuovi', 'nuove'],
|
||||||
|
'now_playing':['cinema', 'in sala'],
|
||||||
|
'channels_anime':['anime'],
|
||||||
|
'genres':['genere', 'generi', 'categorie', 'categoria'],
|
||||||
|
'channels_animation': ['animazione', 'cartoni', 'cartoon', 'animation'],
|
||||||
|
'channels_action':['azione', 'arti marziali', 'action'],
|
||||||
|
'channels_adventure': ['avventura', 'adventure'],
|
||||||
|
'channels_biographical':['biografico'],
|
||||||
|
'channels_comedy':['comico','commedia', 'demenziale', 'comedy'],
|
||||||
|
'channels_adult':['erotico', 'hentai', 'harem', 'ecchi'],
|
||||||
|
'channels_drama':['drammatico', 'drama'],
|
||||||
|
'channels_syfy':['fantascienza', 'science fiction'],
|
||||||
|
'channels_fantasy':['fantasy', 'magia'],
|
||||||
|
'channels_crime':['gangster','poliziesco', 'crime', 'crimine'],
|
||||||
|
'channels_grotesque':['grottesco'],
|
||||||
|
'channels_war':['guerra', 'war'],
|
||||||
|
'channels_children':['bambini', 'kids'],
|
||||||
|
'horror':['horror'],
|
||||||
|
'lucky': ['fortunato'],
|
||||||
|
'channels_musical':['musical', 'musica', 'music'],
|
||||||
|
'channels_mistery':['mistero', 'giallo', 'mystery'],
|
||||||
|
'channels_noir':['noir'],
|
||||||
|
'popular' : ['popolari','popolare', 'più visti'],
|
||||||
|
'thriller':['thriller'],
|
||||||
|
'top_rated' : ['fortunato', 'votati'],
|
||||||
|
'on_the_air' : ['corso', 'onda', 'diretta', 'dirette'],
|
||||||
|
'channels_western':['western'],
|
||||||
|
'channels_vos':['sub','sub-ita'],
|
||||||
|
'channels_romance':['romantico','sentimentale', 'romance'],
|
||||||
|
'channels_family':['famiglia','famiglie', 'family'],
|
||||||
|
'channels_historical':['storico', 'history', 'storia'],
|
||||||
|
'channels_az':['lettera','lista','alfabetico','a-z'],
|
||||||
|
'channels_year':['anno', 'anni'],
|
||||||
|
'update':['replay', 'update'],
|
||||||
|
'autoplay':[config.get_localized_string(60071)]
|
||||||
|
}
|
||||||
|
|
||||||
icon_dict = {'channels_movie':['film'],
|
suffix_dict = {'_hd':['hd','altadefinizione','alta definizione'],
|
||||||
'channels_tvshow':['serie','tv','episodi','episodio','fiction'],
|
'_4k':['4K'],
|
||||||
'channels_documentary':['documentari','documentario', 'documentary'],
|
'_az':['lettera','lista','alfabetico','a-z'],
|
||||||
'channels_all':['tutti'],
|
'_year':['anno', 'anni'],
|
||||||
'news':['novità', "novita'", 'aggiornamenti', 'nuovi', 'nuove'],
|
'_genre':['genere', 'generi', 'categorie', 'categoria']}
|
||||||
'now_playing':['cinema', 'in sala'],
|
|
||||||
'channels_anime':['anime'],
|
|
||||||
'genres':['genere', 'generi', 'categorie', 'categoria'],
|
|
||||||
'channels_animation': ['animazione', 'cartoni', 'cartoon', 'animation'],
|
|
||||||
'channels_action':['azione', 'arti marziali', 'action'],
|
|
||||||
'channels_adventure': ['avventura', 'adventure'],
|
|
||||||
'channels_biographical':['biografico'],
|
|
||||||
'channels_comedy':['comico','commedia', 'demenziale', 'comedy'],
|
|
||||||
'channels_adult':['erotico', 'hentai', 'harem', 'ecchi'],
|
|
||||||
'channels_drama':['drammatico', 'drama'],
|
|
||||||
'channels_syfy':['fantascienza', 'science fiction'],
|
|
||||||
'channels_fantasy':['fantasy', 'magia'],
|
|
||||||
'channels_crime':['gangster','poliziesco', 'crime', 'crimine'],
|
|
||||||
'channels_grotesque':['grottesco'],
|
|
||||||
'channels_war':['guerra', 'war'],
|
|
||||||
'channels_children':['bambini', 'kids'],
|
|
||||||
'horror':['horror'],
|
|
||||||
'lucky': ['fortunato'],
|
|
||||||
'channels_musical':['musical', 'musica', 'music'],
|
|
||||||
'channels_mistery':['mistero', 'giallo', 'mystery'],
|
|
||||||
'channels_noir':['noir'],
|
|
||||||
'popular' : ['popolari','popolare', 'più visti'],
|
|
||||||
'thriller':['thriller'],
|
|
||||||
'top_rated' : ['fortunato', 'votati'],
|
|
||||||
'on_the_air' : ['corso', 'onda', 'diretta', 'dirette'],
|
|
||||||
'channels_western':['western'],
|
|
||||||
'channels_vos':['sub','sub-ita'],
|
|
||||||
'channels_romance':['romantico','sentimentale', 'romance'],
|
|
||||||
'channels_family':['famiglia','famiglie', 'family'],
|
|
||||||
'channels_historical':['storico', 'history', 'storia'],
|
|
||||||
'channels_az':['lettera','lista','alfabetico','a-z'],
|
|
||||||
'channels_year':['anno', 'anni'],
|
|
||||||
'update':['replay', 'update'],
|
|
||||||
'autoplay':[config.get_localized_string(60071)]
|
|
||||||
}
|
|
||||||
|
|
||||||
suffix_dict = {'_hd':['hd','altadefinizione','alta definizione'],
|
search = ['cerca']
|
||||||
'_4k':['4K'],
|
|
||||||
'_az':['lettera','lista','alfabetico','a-z'],
|
|
||||||
'_year':['anno', 'anni'],
|
|
||||||
'_genre':['genere', 'generi', 'categorie', 'categoria']}
|
|
||||||
|
|
||||||
search = ['cerca']
|
search_suffix ={'_movie':['film'],
|
||||||
|
'_tvshow':['serie','tv', 'fiction']}
|
||||||
|
|
||||||
search_suffix ={'_movie':['film'],
|
def autoselect_thumb(item, genre):
|
||||||
'_tvshow':['serie','tv', 'fiction']}
|
if genre == False:
|
||||||
|
for thumb, titles in icon_dict.items():
|
||||||
for item in itemlist:
|
if any( word in re.split(r'\.|\{|\}|\[|\]|\(|\)| ',item.title.lower()) for word in search):
|
||||||
|
thumb = 'search'
|
||||||
if genre == False:
|
for suffix, titles in search_suffix.items():
|
||||||
|
if any( word in re.split(r'\.|\{|\}|\[|\]|\(|\)| ',item.title.lower()) for word in titles ):
|
||||||
for thumb, titles in icon_dict.items():
|
thumb = thumb + suffix
|
||||||
if any( word in re.split(r'\.|\{|\}|\[|\]|\(|\)| ',item.title.lower()) for word in search):
|
item.thumbnail = get_thumb(thumb + '.png')
|
||||||
thumb = 'search'
|
elif any( word in re.split(r'\.|\{|\}|\[|\]|\(|\)| ',item.title.lower()) for word in titles ):
|
||||||
for suffix, titles in search_suffix.items():
|
if thumb == 'channels_movie' or thumb == 'channels_tvshow':
|
||||||
|
for suffix, titles in suffix_dict.items():
|
||||||
if any( word in re.split(r'\.|\{|\}|\[|\]|\(|\)| ',item.title.lower()) for word in titles ):
|
if any( word in re.split(r'\.|\{|\}|\[|\]|\(|\)| ',item.title.lower()) for word in titles ):
|
||||||
thumb = thumb + suffix
|
thumb = thumb + suffix
|
||||||
item.thumbnail = get_thumb(thumb + '.png')
|
item.thumbnail = get_thumb(thumb + '.png')
|
||||||
elif any( word in re.split(r'\.|\{|\}|\[|\]|\(|\)| ',item.title.lower()) for word in titles ):
|
else: item.thumbnail = get_thumb(thumb + '.png')
|
||||||
if thumb == 'channels_movie' or thumb == 'channels_tvshow':
|
else:
|
||||||
for suffix, titles in suffix_dict.items():
|
thumb = item.thumbnail
|
||||||
if any( word in re.split(r'\.|\{|\}|\[|\]|\(|\)| ',item.title.lower()) for word in titles ):
|
|
||||||
thumb = thumb + suffix
|
|
||||||
item.thumbnail = get_thumb(thumb + '.png')
|
|
||||||
else: item.thumbnail = get_thumb(thumb + '.png')
|
|
||||||
else:
|
|
||||||
thumb = item.thumbnail
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
for thumb, titles in icon_dict.items():
|
for thumb, titles in icon_dict.items():
|
||||||
if any(word in re.split(r'\.|\{|\}|\[|\]|\(|\)| ',item.title.lower()) for word in titles ):
|
if any(word in re.split(r'\.|\{|\}|\[|\]|\(|\)| ',item.title.lower()) for word in titles ):
|
||||||
item.thumbnail = get_thumb(thumb + '.png')
|
item.thumbnail = get_thumb(thumb + '.png')
|
||||||
else:
|
else:
|
||||||
thumb = item.thumbnail
|
thumb = item.thumbnail
|
||||||
|
|
||||||
|
item.title = re.sub(r'\s*\{[^\}]+\}','',item.title)
|
||||||
|
return item
|
||||||
|
if item_or_itemlist:
|
||||||
|
if type(item_or_itemlist) == list:
|
||||||
|
for item in item_or_itemlist:
|
||||||
|
autoselect_thumb(item, genre)
|
||||||
|
return item_or_itemlist
|
||||||
|
|
||||||
|
else:
|
||||||
|
return autoselect_thumb(item_or_itemlist, genre)
|
||||||
|
|
||||||
item.title = re.sub(r'\s*\{[^\}]+\}','',item.title)
|
|
||||||
return itemlist
|
|
||||||
elif thumb:
|
elif thumb:
|
||||||
return get_thumb(thumb)
|
return get_thumb(thumb)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -377,7 +377,10 @@ def get_menu(item, json, key, itemlist=[]):
|
|||||||
elif 'submenu' in option:
|
elif 'submenu' in option:
|
||||||
get_sub_menu(it, option, 'submenu' ,itemlist)
|
get_sub_menu(it, option, 'submenu' ,itemlist)
|
||||||
|
|
||||||
return support.thumb(itemlist)
|
for item in itemlist:
|
||||||
|
if not item.thumbnail: support.thumb(item)
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def get_sub_menu(item, json, key, itemlist=[]):
|
def get_sub_menu(item, json, key, itemlist=[]):
|
||||||
|
|||||||
Reference in New Issue
Block a user