KoD 1.5.3
- correzioni di alcuni bug (citiamo ad esempio il crash con il refresh rate e l'impossibilita di entrare nel menu server bloccati) - fix per cambio di struttura a qualche canale/server - migliorie interne
This commit is contained in:
+68
-63
@@ -217,46 +217,12 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
||||
val = domain + val
|
||||
scraped[kk] = val.strip() if type(val) == str else val
|
||||
|
||||
episode = ''
|
||||
if not group or item.grouped:
|
||||
if scraped['season'] and scraped['episode']:
|
||||
stagione = scraped['season']
|
||||
ep = unifyEp(scraped['episode'])
|
||||
if 'x' in ep:
|
||||
episode = ep.split('x')[0].strip()
|
||||
second_episode = ep.split('x')[1].strip()
|
||||
else:
|
||||
episode = ep
|
||||
second_episode = ''
|
||||
item.infoLabels['season'] = int(scraped['season'])
|
||||
item.infoLabels['episode'] = int(episode)
|
||||
episode = str(int(scraped['season'])) +'x'+ str(int(episode)).zfill(2) + ('x' + str(int(second_episode)).zfill(2) if second_episode else '')
|
||||
elif item.season:
|
||||
item.infoLabels['season'] = int(item.season)
|
||||
item.infoLabels['episode'] = int(scrapertools.find_single_match(scraped['episode'], r'(\d+)'))
|
||||
episode = item.season +'x'+ scraped['episode']
|
||||
elif item.contentType == 'tvshow' and (scraped['episode'] == '' and scraped['season'] == '' and stagione == ''):
|
||||
item.news = 'season_completed'
|
||||
episode = ''
|
||||
else:
|
||||
episode = unifyEp(scraped['episode']) if scraped['episode'] else ''
|
||||
try:
|
||||
if 'x' in episode:
|
||||
ep = episode.split('x')
|
||||
episode = str(int(ep[0])).zfill(1) + 'x' + str(int(ep[1])).zfill(2)
|
||||
item.infoLabels['season'] = int(ep[0])
|
||||
item.infoLabels['episode'] = int(ep[1])
|
||||
second_episode = scrapertools.find_single_match(episode, r'x\d+x(\d+)')
|
||||
if second_episode: episode = re.sub(r'(\d+x\d+)x\d+',r'\1-', episode) + second_episode.zfill(2)
|
||||
except:
|
||||
logger.debug('invalid episode: ' + episode)
|
||||
pass
|
||||
|
||||
#episode = re.sub(r'\s-\s|-|x|–|×', 'x', scraped['episode']) if scraped['episode'] else ''
|
||||
# episode = re.sub(r'\s-\s|-|x|–|×', 'x', scraped['episode']) if scraped['episode'] else ''
|
||||
title = cleantitle(scraped.get('title', ''))
|
||||
if group and scraped.get('title', '') in contents and not item.grouped: # same title and grouping enabled
|
||||
continue
|
||||
if item.grouped and scraped.get('title', '') != item.fulltitle: # inside a group different tvshow should not be included
|
||||
if item.grouped and scraped.get('title',
|
||||
'') != item.fulltitle: # inside a group different tvshow should not be included
|
||||
continue
|
||||
contents.append(title)
|
||||
title2 = cleantitle(scraped.get('title2', '')) if not group or item.grouped else ''
|
||||
@@ -278,7 +244,8 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
||||
if scraped["plot"]:
|
||||
infolabels['plot'] = plot
|
||||
if scraped['duration']:
|
||||
matches = scrapertools.find_multiple_matches(scraped['duration'],r'([0-9])\s*?(?:[hH]|:|\.|,|\\|\/|\||\s)\s*?([0-9]+)')
|
||||
matches = scrapertools.find_multiple_matches(scraped['duration'],
|
||||
r'([0-9])\s*?(?:[hH]|:|\.|,|\\|\/|\||\s)\s*?([0-9]+)')
|
||||
for h, m in matches:
|
||||
scraped['duration'] = int(h) * 60 + int(m)
|
||||
if not matches:
|
||||
@@ -293,6 +260,41 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
||||
if scraped["rating"]:
|
||||
infolabels['rating'] = scrapertools.decodeHtmlentities(scraped["rating"])
|
||||
|
||||
episode = ''
|
||||
if not group or item.grouped:
|
||||
if scraped['season'] and scraped['episode']:
|
||||
stagione = scraped['season']
|
||||
ep = unifyEp(scraped['episode'])
|
||||
if 'x' in ep:
|
||||
episode = ep.split('x')[0].strip()
|
||||
second_episode = ep.split('x')[1].strip()
|
||||
else:
|
||||
episode = ep
|
||||
second_episode = ''
|
||||
infolabels['season'] = int(scraped['season'])
|
||||
infolabels['episode'] = int(episode)
|
||||
episode = str(int(scraped['season'])) +'x'+ str(int(episode)).zfill(2) + ('x' + str(int(second_episode)).zfill(2) if second_episode else '')
|
||||
elif item.season:
|
||||
infolabels['season'] = int(item.season)
|
||||
infolabels['episode'] = int(scrapertools.find_single_match(scraped['episode'], r'(\d+)'))
|
||||
episode = item.season +'x'+ scraped['episode']
|
||||
elif item.contentType == 'tvshow' and (scraped['episode'] == '' and scraped['season'] == '' and stagione == ''):
|
||||
item.news = 'season_completed'
|
||||
episode = ''
|
||||
else:
|
||||
episode = unifyEp(scraped['episode']) if scraped['episode'] else ''
|
||||
try:
|
||||
if 'x' in episode:
|
||||
ep = episode.split('x')
|
||||
episode = str(int(ep[0])).zfill(1) + 'x' + str(int(ep[1])).zfill(2)
|
||||
infolabels['season'] = int(ep[0])
|
||||
infolabels['episode'] = int(ep[1])
|
||||
second_episode = scrapertools.find_single_match(episode, r'x\d+x(\d+)')
|
||||
if second_episode: episode = re.sub(r'(\d+x\d+)x\d+',r'\1-', episode) + second_episode.zfill(2)
|
||||
except:
|
||||
logger.debug('invalid episode: ' + episode)
|
||||
pass
|
||||
|
||||
# make formatted Title [longtitle]
|
||||
s = ' - '
|
||||
# title = episode + (s if episode and title else '') + title
|
||||
@@ -318,24 +320,26 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
||||
|
||||
if type(parsedTitle.get('season')) == list:
|
||||
longtitle += str(parsedTitle.get('season')[0]) + '-' + str(parsedTitle.get('season')[-1])
|
||||
infolabels['season'] = parsedTitle.get('season')[0]
|
||||
else:
|
||||
longtitle += str(parsedTitle.get('season'))
|
||||
infolabels['season'] = parsedTitle.get('season')
|
||||
|
||||
if type(parsedTitle.get('episode')) == list:
|
||||
longtitle += 'x' + str(parsedTitle.get('episode')[0]).zfill(2) + '-' + str(parsedTitle.get('episode')[-1]).zfill(2)
|
||||
infolabels['episode'] = parsedTitle.get('episode')[0]
|
||||
else:
|
||||
longtitle += 'x' + str(parsedTitle.get('episode')).zfill(2)
|
||||
infolabels['episode'] = parsedTitle.get('episode')
|
||||
|
||||
item.contentSeason = parsedTitle.get('season')
|
||||
item.contentEpisodeNumber = parsedTitle.get('episode')
|
||||
elif parsedTitle.get('season') and type(parsedTitle.get('season')) == list:
|
||||
longtitle += s + config.get_localized_string(30140) + " " +str(parsedTitle.get('season')[0]) + '-' + str(parsedTitle.get('season')[-1])
|
||||
elif parsedTitle.get('season'):
|
||||
longtitle += s + config.get_localized_string(60027) % str(parsedTitle.get('season'))
|
||||
item.contentSeason = parsedTitle.get('season')
|
||||
infolabels['season'] = parsedTitle.get('season')
|
||||
if parsedTitle.get('episode_title'):
|
||||
longtitle += s + parsedTitle.get('episode_title')
|
||||
item.contentEpisodeTitle = parsedTitle.get('episode_title')
|
||||
infolabels['episodeName'] = parsedTitle.get('episode_title')
|
||||
except:
|
||||
import traceback
|
||||
logger.error(traceback.format_exc())
|
||||
@@ -1159,25 +1163,26 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
||||
# s = servertools.get_server_from_url(videoitem.url)
|
||||
# videoitem.server = s[2] if s else 'directo'
|
||||
# videoitem.title = s[0] if s else config.get_localized_string(30137)
|
||||
srv_param = servertools.get_server_parameters(videoitem.server.lower())
|
||||
if not srv_param: # do not exists or it's empty
|
||||
findS = servertools.get_server_from_url(videoitem.url)
|
||||
info(findS)
|
||||
if not findS:
|
||||
if item.channel == 'community':
|
||||
findS= (config.get_localized_string(30137), videoitem.url, 'directo')
|
||||
else:
|
||||
videoitem.url = unshortenit.unshorten_only(videoitem.url)[0]
|
||||
findS = servertools.get_server_from_url(videoitem.url)
|
||||
if not findS:
|
||||
info(videoitem, 'Non supportato')
|
||||
return
|
||||
videoitem.server = findS[2]
|
||||
videoitem.title = findS[0]
|
||||
videoitem.url = findS[1]
|
||||
if not videoitem.video_urls:
|
||||
srv_param = servertools.get_server_parameters(videoitem.server.lower())
|
||||
if not srv_param: # do not exists or it's empty
|
||||
findS = servertools.get_server_from_url(videoitem.url)
|
||||
info(findS)
|
||||
if not findS:
|
||||
if item.channel == 'community':
|
||||
findS= (config.get_localized_string(30137), videoitem.url, 'directo')
|
||||
else:
|
||||
videoitem.url = unshortenit.unshorten_only(videoitem.url)[0]
|
||||
findS = servertools.get_server_from_url(videoitem.url)
|
||||
if not findS:
|
||||
info(videoitem, 'Non supportato')
|
||||
return
|
||||
videoitem.server = findS[2]
|
||||
videoitem.title = findS[0]
|
||||
videoitem.url = findS[1]
|
||||
srv_param = servertools.get_server_parameters(videoitem.server.lower())
|
||||
|
||||
if srv_param.get('active', False):
|
||||
if videoitem.video_urls or srv_param.get('active', False):
|
||||
item.title = typo(item.contentTitle.strip(), 'bold') if item.contentType == 'movie' or (config.get_localized_string(30161) in item.title) else item.title
|
||||
|
||||
quality = videoitem.quality if videoitem.quality else item.quality if item.quality else ''
|
||||
@@ -1186,7 +1191,7 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
||||
videoitem.channel = item.channel
|
||||
videoitem.fulltitle = item.fulltitle
|
||||
videoitem.show = item.show
|
||||
videoitem.thumbnail = item.thumbnail
|
||||
if not videoitem.video_urls: videoitem.thumbnail = item.thumbnail
|
||||
videoitem.contentType = item.contentType
|
||||
videoitem.infoLabels = item.infoLabels
|
||||
videoitem.quality = quality
|
||||
@@ -1198,13 +1203,13 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
||||
|
||||
# non threaded for webpdb
|
||||
# dbg()
|
||||
# thL = [getItem(videoitem) for videoitem in itemlist if videoitem.url]
|
||||
# thL = [getItem(videoitem) for videoitem in itemlist if videoitem.url or videoitem.video_urls]
|
||||
# for it in thL:
|
||||
# if it and not config.get_setting("black_list", server=it.server.lower()):
|
||||
# verifiedItemlist.append(it)
|
||||
#
|
||||
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
thL = [executor.submit(getItem, videoitem) for videoitem in itemlist if videoitem.url]
|
||||
thL = [executor.submit(getItem, videoitem) for videoitem in itemlist if videoitem.url or videoitem.video_urls]
|
||||
for it in futures.as_completed(thL):
|
||||
if it.result() and not config.get_setting("black_list", server=it.result().server.lower()):
|
||||
verifiedItemlist.append(it.result())
|
||||
|
||||
Reference in New Issue
Block a user