fix vari
This commit is contained in:
+12
-16
@@ -152,7 +152,7 @@ def peliculas(item):
|
|||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
else:
|
else:
|
||||||
# debug = True
|
# debug = True
|
||||||
patron = r'div class="card-image">.*?<img src="(?P<thumb>[^ ]+)" alt.*?<a href="(?P<url>[^ >]+)">(?P<title>.*?)(?:&#.*?)?(?P<lang>(?:[Ss][Uu][Bb]-)?[Ii][Tt][Aa])?<\/a>.*?(?:<strong><span style="[^"]+">(?P<genre>[^<>0-9(]+)\((?P<year>[0-9]{4}).*?</(?:p|div)>(?P<plot>.*?))?</div'
|
patron = r'div class="card-image">.*?<img src="(?P<thumb>[^ ]+)" alt.*?<a href="(?P<url>[^ >]+)">(?P<title>.*?)(?P<lang>(?:[Ss][Uu][Bb]-)?[Ii][Tt][Aa])?<\/a>.*?(?:<strong><span style="[^"]+">(?P<genre>[^<>0-9(]+)\((?P<year>[0-9]{4}).*?</(?:p|div)>(?P<plot>.*?))?</div'
|
||||||
action = 'episodios'
|
action = 'episodios'
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
|
|
||||||
@@ -169,30 +169,26 @@ def episodios(item):
|
|||||||
patronBlock = r'(?P<block><div class="sp-head[a-z ]*?" title="Espandi">\s*(?:STAGION[EI]\s*(?:DA\s*[0-9]+\s*A)?\s*[0-9]+|MINISERIE) - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?[^<>]*?<\/div>.*?)<div class="spdiv">\[riduci\]<\/div>'
|
patronBlock = r'(?P<block><div class="sp-head[a-z ]*?" title="Espandi">\s*(?:STAGION[EI]\s*(?:DA\s*[0-9]+\s*A)?\s*[0-9]+|MINISERIE) - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?[^<>]*?<\/div>.*?)<div class="spdiv">\[riduci\]<\/div>'
|
||||||
# patron = '(?:<p>|<strong>)(?P<episode>[0-9]+(?:×|×)[0-9]+)\s*(?P<title2>[^&<]*)?(?:–|-)?\s*(?P<url>.*?)(?:<\/p>|<br)'
|
# patron = '(?:<p>|<strong>)(?P<episode>[0-9]+(?:×|×)[0-9]+)\s*(?P<title2>[^&<]*)?(?:–|-)?\s*(?P<url>.*?)(?:<\/p>|<br)'
|
||||||
patron = r'(?:/>|<p>|<strong>)(?P<url>.*?(?P<episode>[0-9]+(?:×|ÃÂ)[0-9]+)\s*(?P<title2>.*?)?(?:\s*–|\s*-|\s*<).*?)(?:<\/p>|<br)'
|
patron = r'(?:/>|<p>|<strong>)(?P<url>.*?(?P<episode>[0-9]+(?:×|ÃÂ)[0-9]+)\s*(?P<title2>.*?)?(?:\s*–|\s*-|\s*<).*?)(?:<\/p>|<br)'
|
||||||
def fullItemlistHook(itemlist):
|
def itemlistHook(itemlist):
|
||||||
title_dict = {}
|
title_dict = {}
|
||||||
itlist = []
|
itlist = []
|
||||||
special_list = []
|
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
item.title = re.sub(r'\.(\D)',' \\1', item.title)
|
item.title = re.sub(r'\.(\D)',' \\1', item.title)
|
||||||
if re.sub(r'(\[[^\]]+\])','',item.title) in [config.get_localized_string(30161),config.get_localized_string(60355),config.get_localized_string(60357)]:
|
match = support.match(item.title, patron=r'(\d+.\d+)').match.replace('x','')
|
||||||
special_list.append(item)
|
item.order = match
|
||||||
|
if match not in title_dict:
|
||||||
|
title_dict[match] = item
|
||||||
|
elif match in title_dict and item.contentLanguage == title_dict[match].contentLanguage \
|
||||||
|
or item.contentLanguage == 'ITA' and not title_dict[match].contentLanguage \
|
||||||
|
or title_dict[match].contentLanguage == 'ITA' and not item.contentLanguage:
|
||||||
|
title_dict[match].url = item.url
|
||||||
else:
|
else:
|
||||||
match = support.match(item.title, patron=r'(\d+.\d+)').match.replace('x','')
|
title_dict[match + '1'] = item
|
||||||
item.order = match
|
|
||||||
if match not in title_dict:
|
|
||||||
title_dict[match] = item
|
|
||||||
elif match in title_dict and item.contentLanguage == title_dict[match].contentLanguage \
|
|
||||||
or item.contentLanguage == 'ITA' and not title_dict[match].contentLanguage \
|
|
||||||
or title_dict[match].contentLanguage == 'ITA' and not item.contentLanguage:
|
|
||||||
title_dict[match].url = item.url
|
|
||||||
else:
|
|
||||||
title_dict[match + '1'] = item
|
|
||||||
|
|
||||||
for key, value in title_dict.items():
|
for key, value in title_dict.items():
|
||||||
itlist.append(value)
|
itlist.append(value)
|
||||||
|
|
||||||
return sorted(itlist, key=lambda it: (it.contentLanguage, int(it.order))) + special_list
|
return sorted(itlist, key=lambda it: (it.contentLanguage, int(it.order)))
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+8
-1
@@ -301,7 +301,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
|||||||
infoLabels=infolabels,
|
infoLabels=infolabels,
|
||||||
thumbnail=item.thumbnail if function == 'episodios' and not scraped["thumb"] else scraped["thumb"] if scraped["thumb"] else '',
|
thumbnail=item.thumbnail if function == 'episodios' and not scraped["thumb"] else scraped["thumb"] if scraped["thumb"] else '',
|
||||||
args=item.args,
|
args=item.args,
|
||||||
contentSerieName= scraped['title'] if item.contentType or CT != 'movie' and function != 'episodios' else item.fulltitle if function == 'episodios' else '',
|
contentSerieName= scraped['title'] if scraped['title'] else item.fulltitle if item.contentType or CT != 'movie' and function != 'episodios' else item.fulltitle if function == 'episodios' else '',
|
||||||
contentTitle= scraped['title'] if item.contentType or CT == 'movie' else '',
|
contentTitle= scraped['title'] if item.contentType or CT == 'movie' else '',
|
||||||
contentLanguage = lang1,
|
contentLanguage = lang1,
|
||||||
contentEpisodeNumber=episode if episode else '',
|
contentEpisodeNumber=episode if episode else '',
|
||||||
@@ -963,6 +963,13 @@ def videolibrary(itemlist, item, typography='', function_level=1, function=''):
|
|||||||
contentType = 'tvshow'
|
contentType = 'tvshow'
|
||||||
|
|
||||||
function = function if function else inspect.stack()[function_level][3]
|
function = function if function else inspect.stack()[function_level][3]
|
||||||
|
# go up until find findvideos/episodios
|
||||||
|
while function not in ['findvideos', 'episodios']:
|
||||||
|
function_level += 1
|
||||||
|
try:
|
||||||
|
function = inspect.stack()[function_level][3]
|
||||||
|
except:
|
||||||
|
break
|
||||||
|
|
||||||
if not typography: typography = 'color kod bold'
|
if not typography: typography = 'color kod bold'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user