- Fix SerieHD
- Fix VVVVID - Fix TMDB - Fix Rinumerazione - Fix Mediaset (Rimossa Numerazione)
This commit is contained in:
@@ -174,27 +174,27 @@ def peliculas(item):
|
||||
for it in json:
|
||||
if item.search.lower() in it['title'].lower() and it['title'] not in titlelist:
|
||||
titlelist.append(it['title'])
|
||||
if item.contentType == 'movie':
|
||||
# if item.contentType == 'movie':
|
||||
# action = 'findvideos'
|
||||
# urls = []
|
||||
# if 'media' not in it: it = subBrand(it['mediasetprogram$brandId'])[-1]
|
||||
# if 'media' in it:
|
||||
# for key in it['media']:
|
||||
# urls.append(key['publicUrl'])
|
||||
# elif item.contentType == 'tvshow':
|
||||
# action = 'epmenu'
|
||||
# urls = it['mediasetprogram$brandId']
|
||||
# else:
|
||||
if 'media' in it:
|
||||
action = 'findvideos'
|
||||
contentType = 'movie'
|
||||
urls = []
|
||||
if 'media' not in it: it = subBrand(it['mediasetprogram$brandId'])[-1]
|
||||
if 'media' in it:
|
||||
for key in it['media']:
|
||||
urls.append(key['publicUrl'])
|
||||
elif item.contentType == 'tvshow':
|
||||
action = 'epmenu'
|
||||
urls = it['mediasetprogram$brandId']
|
||||
for key in it['media']:
|
||||
urls.append(key['publicUrl'])
|
||||
else:
|
||||
if 'media' in it:
|
||||
action = 'findvideos'
|
||||
contentType = 'movie'
|
||||
urls = []
|
||||
for key in it['media']:
|
||||
urls.append(key['publicUrl'])
|
||||
else:
|
||||
action = 'epmenu'
|
||||
contentType = 'tvshow'
|
||||
urls = it['mediasetprogram$brandId']
|
||||
action = 'epmenu'
|
||||
contentType = 'tvshow'
|
||||
urls = it['mediasetprogram$brandId']
|
||||
if urls:
|
||||
title = it['mediasetprogram$brandTitle'] + ' - ' if 'mediasetprogram$brandTitle' in it and it['mediasetprogram$brandTitle'] != it['title'] else ''
|
||||
itemlist.append(
|
||||
@@ -254,14 +254,14 @@ def episodios(item):
|
||||
for key in it['media']:
|
||||
urls.append(key['publicUrl'])
|
||||
if urls:
|
||||
title = it['title'].split('-')[-1].strip()
|
||||
if it['tvSeasonNumber'] and it['tvSeasonEpisodeNumber'] and 'puntata del' not in title.lower():
|
||||
item.infoLabels['season'] = it['tvSeasonNumber']
|
||||
item.infoLabels['episode'] = it['tvSeasonEpisodeNumber']
|
||||
episode = '%dx%02d - ' % (it['tvSeasonNumber'], it['tvSeasonEpisodeNumber'])
|
||||
title = it['title']
|
||||
# if it['tvSeasonNumber'] and it['tvSeasonEpisodeNumber'] and 'puntata del' not in title.lower():
|
||||
# item.infoLabels['season'] = it['tvSeasonNumber']
|
||||
# item.infoLabels['episode'] = it['tvSeasonEpisodeNumber']
|
||||
# episode = '%dx%02d - ' % (it['tvSeasonNumber'], it['tvSeasonEpisodeNumber'])
|
||||
itemlist.append(
|
||||
item.clone(action='findvideos',
|
||||
title=support.typo(episode + title, 'bold'),
|
||||
title=support.typo(title, 'bold'),
|
||||
contentType='episode',
|
||||
thumbnail=it['thumbnails']['image_vertical-264x396']['url'] if 'image_vertical-264x396' in it['thumbnails'] else '',
|
||||
fanart=it['thumbnails']['image_keyframe_poster-1280x720']['url'] if 'image_keyframe_poster-1280x720' in it['thumbnails'] else '',
|
||||
@@ -271,9 +271,12 @@ def episodios(item):
|
||||
year=it.get('year',''),
|
||||
forcethumb=True,
|
||||
no_return=True))
|
||||
if episode:
|
||||
itemlist = sorted(itemlist, key=lambda it: it.title)
|
||||
support.videolibrary(itemlist, item)
|
||||
# support.dbg()
|
||||
if 'episodi' in item.title.lower() or 'puntate intere' in item.title.lower():
|
||||
itemlist.reverse()
|
||||
# if episode:
|
||||
# itemlist = sorted(itemlist, key=lambda it: it.title)
|
||||
# support.videolibrary(itemlist, item)
|
||||
return itemlist
|
||||
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ def search(item, texto):
|
||||
|
||||
|
||||
item.contentType = 'tvshow'
|
||||
item.url = host + "/search/" + texto
|
||||
item.url = host + "/?s=" + texto
|
||||
try:
|
||||
return peliculas(item)
|
||||
# Continua la ricerca in caso di errore .
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Canale per vvvvid
|
||||
# ----------------------------------------------------------
|
||||
import requests, sys, inspect
|
||||
from core import support, tmdb
|
||||
from core import jsontools, support, tmdb
|
||||
from platformcode import autorenumber, logger, config
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
@@ -135,41 +135,35 @@ def peliculas(item):
|
||||
|
||||
def episodios(item):
|
||||
itemlist = []
|
||||
json_file = current_session.get(item.url, headers=headers, params=payload).json()
|
||||
for i, block in enumerate(json_file['data']):
|
||||
if len(json_file['data']) > 1:
|
||||
prepend = str(i + 1) + 'x'
|
||||
if item.episodes:
|
||||
episodes = item.episodes
|
||||
show_id = item.show_id
|
||||
season_id = item.season_id
|
||||
else:
|
||||
json_file = current_session.get(item.url, headers=headers, params=payload).json()['data']
|
||||
if len(json_file) > 1:
|
||||
for key in json_file:
|
||||
itemlist.append(item.clone(title=support.typo(key['name'],'bold'), show_id = str(key['show_id']), season_id = str(key['season_id']), episodes = key['episodes']))
|
||||
return itemlist
|
||||
else:
|
||||
prepend = 'Episodio '
|
||||
show_id = str(block['show_id'])
|
||||
season_id = str(block['season_id'])
|
||||
episodes = []
|
||||
support.info('SEASON ID= ',season_id)
|
||||
for episode in json_file['data']:
|
||||
episodes.append(episode['episodes'])
|
||||
for episode in episodes:
|
||||
for key in episode:
|
||||
if 'stagione' in encode(key['title']).lower():
|
||||
season = support.match(encode(key['title']), patron=r'[Ss]tagione\s*(\d+)').match
|
||||
episode = support.match(encode(key['title']), patron=r'[Ee]pisodio\s*(\d+)').match
|
||||
if season and episode:
|
||||
title = season + 'x' + episode + ' - ' + item.fulltitle
|
||||
make_item = True
|
||||
elif int(key['season_id']) == int(season_id):
|
||||
try:
|
||||
title = prepend + key['number'] + ' - ' + key['title'].encode('utf8')
|
||||
except:
|
||||
title = prepend + key['number'] + ' - ' + key['title']
|
||||
make_item = True
|
||||
else:
|
||||
make_item = False
|
||||
if make_item == True:
|
||||
if type(title) == tuple: title = title[0]
|
||||
itemlist.append(
|
||||
item.clone(title = title,
|
||||
url= host + show_id + '/season/' + str(key['season_id']),
|
||||
action= 'findvideos',
|
||||
video_id= key['video_id']))
|
||||
episodes = json_file[0]['episodes']
|
||||
show_id = str(json_file[0]['show_id'])
|
||||
season_id = str(json_file[0]['season_id'])
|
||||
|
||||
|
||||
for episode in episodes:
|
||||
try:
|
||||
title = 'Episodio ' + episode['number'] + ' - ' + episode['title'].encode('utf8')
|
||||
except:
|
||||
title = 'Episodio ' + episode['number'] + ' - ' + episode['title']
|
||||
|
||||
if type(title) == tuple: title = title[0]
|
||||
itemlist.append(
|
||||
item.clone(title = support.typo(title, 'bold'),
|
||||
url= host + show_id + '/season/' + str(season_id),
|
||||
action= 'findvideos',
|
||||
video_id= episode['video_id']))
|
||||
|
||||
if inspect.stack()[1][3] not in ['find_episodes']:
|
||||
autorenumber.start(itemlist, item)
|
||||
if autorenumber.check(item) == True \
|
||||
|
||||
15
core/tmdb.py
15
core/tmdb.py
@@ -269,7 +269,7 @@ def set_infoLabels_item(item, seekTmdb=True, idioma_busqueda=def_lang, lock=None
|
||||
otmdb_global = Tmdb(id_Tmdb=item.infoLabels['tmdb_id'], tipo=tipo_busqueda,
|
||||
idioma_busqueda=idioma_busqueda)
|
||||
else:
|
||||
otmdb_global = Tmdb(texto_buscado=item.infoLabels['tvshowtitle'], tipo=tipo_busqueda,
|
||||
otmdb_global = Tmdb(texto_buscado=scrapertools.unescape(item.infoLabels['tvshowtitle']), tipo=tipo_busqueda,
|
||||
idioma_busqueda=idioma_busqueda, year=item.infoLabels['year'])
|
||||
|
||||
__leer_datos(otmdb_global)
|
||||
@@ -381,7 +381,7 @@ def set_infoLabels_item(item, seekTmdb=True, idioma_busqueda=def_lang, lock=None
|
||||
# do it by title
|
||||
if tipo_busqueda == 'tv':
|
||||
# Serial search by title and filtering your results if necessary
|
||||
otmdb = Tmdb(texto_buscado=item.infoLabels['tvshowtitle'], tipo=tipo_busqueda,
|
||||
otmdb = Tmdb(texto_buscado=scrapertools.unescape(item.infoLabels['tvshowtitle']), tipo=tipo_busqueda,
|
||||
idioma_busqueda=idioma_busqueda, filtro=item.infoLabels.get('filtro', {}),
|
||||
year=item.infoLabels['year'])
|
||||
else:
|
||||
@@ -389,7 +389,7 @@ def set_infoLabels_item(item, seekTmdb=True, idioma_busqueda=def_lang, lock=None
|
||||
# if item.infoLabels['year'] or item.infoLabels['filtro']:
|
||||
# ...and year or filter
|
||||
searched_title = item.contentTitle if item.contentTitle else item.fulltitle
|
||||
otmdb = Tmdb(texto_buscado=searched_title, tipo=tipo_busqueda, idioma_busqueda=idioma_busqueda,
|
||||
otmdb = Tmdb(texto_buscado=scrapertools.unescape(searched_title), tipo=tipo_busqueda, idioma_busqueda=idioma_busqueda,
|
||||
filtro=item.infoLabels.get('filtro', {}), year=item.infoLabels['year'])
|
||||
if otmdb is not None:
|
||||
if otmdb.get_id() and config.get_setting("tmdb_plus_info", default=False):
|
||||
@@ -481,7 +481,7 @@ def find_and_set_infoLabels(item):
|
||||
|
||||
if not item.infoLabels.get("tmdb_id") or not item.infoLabels.get("tmdb_id")[0].isdigit():
|
||||
if not item.infoLabels.get("imdb_id"):
|
||||
otmdb_global = Tmdb(texto_buscado=title, tipo=tipo_busqueda, year=item.infoLabels['year'])
|
||||
otmdb_global = Tmdb(texto_buscado=scrapertools.unescape(title), tipo=tipo_busqueda, year=item.infoLabels['year'])
|
||||
else:
|
||||
otmdb_global = Tmdb(external_id=item.infoLabels.get("imdb_id"), external_source="imdb_id", tipo=tipo_busqueda)
|
||||
elif not otmdb_global or str(otmdb_global.result.get("id")) != item.infoLabels['tmdb_id']:
|
||||
@@ -528,14 +528,17 @@ def get_nfo(item, search_groups=False):
|
||||
path = filetools.join(config.get_data_path(), "settings_channels", item.channel + "_data.json")
|
||||
if filetools.exists(path):
|
||||
g = jsontools.load(filetools.read(path)).get(RENUMBER,{}).get(item.fulltitle.strip(),{}).get(GROUP,'')
|
||||
if g: return g + '\n'
|
||||
if g:
|
||||
if type(g) == list: g = ', '.join(g)
|
||||
return g + '\n'
|
||||
|
||||
groups = get_groups(item)
|
||||
|
||||
if groups:
|
||||
Id = select_group(groups, item)
|
||||
if Id == 'original':
|
||||
pass
|
||||
info_nfo = ', '.join(item.infoLabels['url_scraper']) + "\n"
|
||||
return info_nfo
|
||||
elif Id :
|
||||
info_nfo = 'https://www.themoviedb.org/tv/{}/episode_group/{}\n'.format(item.infoLabels['tmdb_id'], Id)
|
||||
return info_nfo
|
||||
|
||||
@@ -184,6 +184,28 @@ class autorenumber():
|
||||
itemlist = find_episodes(self.item)
|
||||
busy(False)
|
||||
|
||||
if not self.group:
|
||||
self.group = tmdb.get_nfo(self.item, search_groups=True)
|
||||
|
||||
if 'episode_group' in self.group:
|
||||
seasons =[]
|
||||
groupedSeasons = tmdb.get_group(self.group.replace('\n','').split('/')[-1])
|
||||
for groupedSeason in groupedSeasons:
|
||||
seasons.append({'season_number':groupedSeason['order'], 'episode_count':len(groupedSeason['episodes'])})
|
||||
else:
|
||||
seasons = tmdb.Tmdb(id_Tmdb=self.id).get_list_episodes()
|
||||
|
||||
count = 0
|
||||
|
||||
for season in seasons:
|
||||
s = season['season_number']
|
||||
c = season['episode_count']
|
||||
self.seasonsdict[str(s)] = c
|
||||
if s > 0:
|
||||
for e in range(1, c + 1):
|
||||
count += 1
|
||||
self.epdict[count] = '{}x{:02d}'.format(s,e)
|
||||
|
||||
if self.item.renumber or self.manual:
|
||||
self.item.renumber = False
|
||||
self.season, self.episode, self.manual, self.specials, Manual, Exit = SelectreNumeration(self, itemlist)
|
||||
@@ -194,32 +216,6 @@ class autorenumber():
|
||||
self.episodes = Manual
|
||||
|
||||
else:
|
||||
if self.group:
|
||||
Id = self.group.split('/')[-1]
|
||||
else:
|
||||
Id = None
|
||||
groups = tmdb.get_groups(self.item)
|
||||
if groups:
|
||||
Id = tmdb.select_group(groups, self.item)
|
||||
|
||||
if Id and Id != 'original':
|
||||
self.group = 'https://www.themoviedb.org/tv/{}/episode_group/{}'.format(self.item.infoLabels['tmdb_id'], Id)
|
||||
seasons = []
|
||||
groupedSeasons = tmdb.get_group(Id)
|
||||
for groupedSeason in groupedSeasons:
|
||||
seasons.append({'season_number':groupedSeason['order'], 'episode_count':len(groupedSeason['episodes'])})
|
||||
else:
|
||||
seasons = tmdb.Tmdb(id_Tmdb=self.id).get_list_episodes()
|
||||
count = 0
|
||||
for season in seasons:
|
||||
s = season['season_number']
|
||||
c = season['episode_count']
|
||||
self.seasonsdict[str(s)] = c
|
||||
if s > 0:
|
||||
for e in range(1, c + 1):
|
||||
count += 1
|
||||
self.epdict[count] = '{}x{:02d}'.format(s,e)
|
||||
|
||||
firstep = 0
|
||||
if self.season > 1:
|
||||
for c in range(1, self.season):
|
||||
|
||||
Reference in New Issue
Block a user