Fix AutoThumb e Typo
This commit is contained in:
+5
-5
@@ -402,16 +402,16 @@ def thumb(itemlist=[], genre=False, thumb=''):
|
|||||||
if genre == False:
|
if genre == False:
|
||||||
|
|
||||||
for thumb, titles in icon_dict.items():
|
for thumb, titles in icon_dict.items():
|
||||||
if any( word in item.title.lower().split() for word in search):
|
if any( word in re.split(r'\.|\{|\}|\[|\]|\(|\)| ',item.title.lower()) for word in search):
|
||||||
thumb = 'search'
|
thumb = 'search'
|
||||||
for suffix, titles in search_suffix.items():
|
for suffix, titles in search_suffix.items():
|
||||||
if any( word in item.title.lower().split() 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 item.title.lower().split() for word in titles ):
|
elif any( word in re.split(r'\.|\{|\}|\[|\]|\(|\)| ',item.title.lower()) for word in titles ):
|
||||||
if thumb == 'channels_movie' or thumb == 'channels_tvshow':
|
if thumb == 'channels_movie' or thumb == 'channels_tvshow':
|
||||||
for suffix, titles in suffix_dict.items():
|
for suffix, titles in suffix_dict.items():
|
||||||
if any( word in item.title.lower().split() 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')
|
||||||
else: item.thumbnail = get_thumb(thumb + '.png')
|
else: item.thumbnail = get_thumb(thumb + '.png')
|
||||||
@@ -420,7 +420,7 @@ def thumb(itemlist=[], genre=False, thumb=''):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
for thumb, titles in icon_dict.items():
|
for thumb, titles in icon_dict.items():
|
||||||
if any(word in item.title.lower().split() 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.thumbnails
|
thumb = item.thumbnails
|
||||||
|
|||||||
+33
-33
@@ -713,42 +713,42 @@ def typo(string, typography=''):
|
|||||||
# If there are no attributes, it applies the default ones
|
# If there are no attributes, it applies the default ones
|
||||||
attribute = ['[]','()','{}','submenu','color','bold','italic','_','--','[B]','[I]','[COLOR]']
|
attribute = ['[]','()','{}','submenu','color','bold','italic','_','--','[B]','[I]','[COLOR]']
|
||||||
|
|
||||||
movie_word_list = ['film', 'serie', 'tv', 'anime', 'cinema', 'sala']
|
# movie_word_list = ['film', 'serie', 'tv', 'anime', 'cinema', 'sala']
|
||||||
search_word_list = ['cerca']
|
# search_word_list = ['cerca']
|
||||||
categories_word_list = ['genere', 'categoria', 'categorie', 'ordine', 'lettera', 'anno', 'alfabetico', 'a-z', 'menu']
|
# categories_word_list = ['genere', 'categoria', 'categorie', 'ordine', 'lettera', 'anno', 'alfabetico', 'a-z', 'menu']
|
||||||
|
|
||||||
if not any(word in string for word in attribute):
|
# if not any(word in string for word in attribute):
|
||||||
if any(word in string.lower() for word in search_word_list):
|
# if any(word in string.lower() for word in search_word_list):
|
||||||
string = '[COLOR '+ kod_color +']' + string + '[/COLOR]'
|
# string = '[COLOR '+ kod_color +']' + string + '[/COLOR]'
|
||||||
elif any(word in string.lower() for word in categories_word_list):
|
# elif any(word in string.lower() for word in categories_word_list):
|
||||||
string = ' > ' + string
|
# string = ' > ' + string
|
||||||
elif any(word in string.lower() for word in movie_word_list):
|
# elif any(word in string.lower() for word in movie_word_list):
|
||||||
string = '[B]' + string + '[/B]'
|
# string = '[B]' + string + '[/B]'
|
||||||
|
|
||||||
# Otherwise it uses the typographical attributes of the string
|
# Otherwise it uses the typographical attributes of the string
|
||||||
else:
|
# else:
|
||||||
if '[]' in string:
|
if '[]' in string:
|
||||||
string = '[' + re.sub(r'\s\[\]','',string) + ']'
|
string = '[' + re.sub(r'\s\[\]','',string) + ']'
|
||||||
if '()' in string:
|
if '()' in string:
|
||||||
string = '(' + re.sub(r'\s\(\)','',string) + ')'
|
string = '(' + re.sub(r'\s\(\)','',string) + ')'
|
||||||
if '{}' in string:
|
if '{}' in string:
|
||||||
string = '{' + re.sub(r'\s\{\}','',string) + '}'
|
string = '{' + re.sub(r'\s\{\}','',string) + '}'
|
||||||
if 'submenu' in string:
|
if 'submenu' in string:
|
||||||
string = u"\u2022\u2022 ".encode('utf-8') + re.sub(r'\ssubmenu','',string)
|
string = u"\u2022\u2022 ".encode('utf-8') + re.sub(r'\ssubmenu','',string)
|
||||||
if 'color' in string:
|
if 'color' in string:
|
||||||
color = scrapertoolsV2.find_single_match(string,'color ([a-z]+)')
|
color = scrapertoolsV2.find_single_match(string,'color ([a-z]+)')
|
||||||
if color == 'kod' or '': color = kod_color
|
if color == 'kod' or '': color = kod_color
|
||||||
string = '[COLOR '+ color +']' + re.sub(r'\scolor\s([a-z]+)','',string) + '[/COLOR]'
|
string = '[COLOR '+ color +']' + re.sub(r'\scolor\s([a-z]+)','',string) + '[/COLOR]'
|
||||||
if 'bold' in string:
|
if 'bold' in string:
|
||||||
string = '[B]' + re.sub(r'\sbold','',string) + '[/B]'
|
string = '[B]' + re.sub(r'\sbold','',string) + '[/B]'
|
||||||
if 'italic' in string:
|
if 'italic' in string:
|
||||||
string = '[I]' + re.sub(r'\sitalic','',string) + '[/I]'
|
string = '[I]' + re.sub(r'\sitalic','',string) + '[/I]'
|
||||||
if '_' in string:
|
if '_' in string:
|
||||||
string = ' ' + re.sub(r'\s_','',string)
|
string = ' ' + re.sub(r'\s_','',string)
|
||||||
if '--' in string:
|
if '--' in string:
|
||||||
string = ' - ' + re.sub(r'\s--','',string)
|
string = ' - ' + re.sub(r'\s--','',string)
|
||||||
if 'bullet' in string:
|
if 'bullet' in string:
|
||||||
string = '[B]' + u"\u2022".encode('utf-8') + '[/B] ' + re.sub(r'\sbullet','',string)
|
string = '[B]' + u"\u2022".encode('utf-8') + '[/B] ' + re.sub(r'\sbullet','',string)
|
||||||
|
|
||||||
return string
|
return string
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user