- 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:
|
for it in json:
|
||||||
if item.search.lower() in it['title'].lower() and it['title'] not in titlelist:
|
if item.search.lower() in it['title'].lower() and it['title'] not in titlelist:
|
||||||
titlelist.append(it['title'])
|
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'
|
action = 'findvideos'
|
||||||
|
contentType = 'movie'
|
||||||
urls = []
|
urls = []
|
||||||
if 'media' not in it: it = subBrand(it['mediasetprogram$brandId'])[-1]
|
for key in it['media']:
|
||||||
if 'media' in it:
|
urls.append(key['publicUrl'])
|
||||||
for key in it['media']:
|
|
||||||
urls.append(key['publicUrl'])
|
|
||||||
elif item.contentType == 'tvshow':
|
|
||||||
action = 'epmenu'
|
|
||||||
urls = it['mediasetprogram$brandId']
|
|
||||||
else:
|
else:
|
||||||
if 'media' in it:
|
action = 'epmenu'
|
||||||
action = 'findvideos'
|
contentType = 'tvshow'
|
||||||
contentType = 'movie'
|
urls = it['mediasetprogram$brandId']
|
||||||
urls = []
|
|
||||||
for key in it['media']:
|
|
||||||
urls.append(key['publicUrl'])
|
|
||||||
else:
|
|
||||||
action = 'epmenu'
|
|
||||||
contentType = 'tvshow'
|
|
||||||
urls = it['mediasetprogram$brandId']
|
|
||||||
if urls:
|
if urls:
|
||||||
title = it['mediasetprogram$brandTitle'] + ' - ' if 'mediasetprogram$brandTitle' in it and it['mediasetprogram$brandTitle'] != it['title'] else ''
|
title = it['mediasetprogram$brandTitle'] + ' - ' if 'mediasetprogram$brandTitle' in it and it['mediasetprogram$brandTitle'] != it['title'] else ''
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
@@ -254,14 +254,14 @@ def episodios(item):
|
|||||||
for key in it['media']:
|
for key in it['media']:
|
||||||
urls.append(key['publicUrl'])
|
urls.append(key['publicUrl'])
|
||||||
if urls:
|
if urls:
|
||||||
title = it['title'].split('-')[-1].strip()
|
title = it['title']
|
||||||
if it['tvSeasonNumber'] and it['tvSeasonEpisodeNumber'] and 'puntata del' not in title.lower():
|
# if it['tvSeasonNumber'] and it['tvSeasonEpisodeNumber'] and 'puntata del' not in title.lower():
|
||||||
item.infoLabels['season'] = it['tvSeasonNumber']
|
# item.infoLabels['season'] = it['tvSeasonNumber']
|
||||||
item.infoLabels['episode'] = it['tvSeasonEpisodeNumber']
|
# item.infoLabels['episode'] = it['tvSeasonEpisodeNumber']
|
||||||
episode = '%dx%02d - ' % (it['tvSeasonNumber'], it['tvSeasonEpisodeNumber'])
|
# episode = '%dx%02d - ' % (it['tvSeasonNumber'], it['tvSeasonEpisodeNumber'])
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(action='findvideos',
|
item.clone(action='findvideos',
|
||||||
title=support.typo(episode + title, 'bold'),
|
title=support.typo(title, 'bold'),
|
||||||
contentType='episode',
|
contentType='episode',
|
||||||
thumbnail=it['thumbnails']['image_vertical-264x396']['url'] if 'image_vertical-264x396' in it['thumbnails'] else '',
|
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 '',
|
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',''),
|
year=it.get('year',''),
|
||||||
forcethumb=True,
|
forcethumb=True,
|
||||||
no_return=True))
|
no_return=True))
|
||||||
if episode:
|
# support.dbg()
|
||||||
itemlist = sorted(itemlist, key=lambda it: it.title)
|
if 'episodi' in item.title.lower() or 'puntate intere' in item.title.lower():
|
||||||
support.videolibrary(itemlist, item)
|
itemlist.reverse()
|
||||||
|
# if episode:
|
||||||
|
# itemlist = sorted(itemlist, key=lambda it: it.title)
|
||||||
|
# support.videolibrary(itemlist, item)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ def search(item, texto):
|
|||||||
|
|
||||||
|
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.url = host + "/search/" + texto
|
item.url = host + "/?s=" + texto
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return peliculas(item)
|
||||||
# Continua la ricerca in caso di errore .
|
# Continua la ricerca in caso di errore .
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# Canale per vvvvid
|
# Canale per vvvvid
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
import requests, sys, inspect
|
import requests, sys, inspect
|
||||||
from core import support, tmdb
|
from core import jsontools, support, tmdb
|
||||||
from platformcode import autorenumber, logger, config
|
from platformcode import autorenumber, logger, config
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
@@ -135,41 +135,35 @@ def peliculas(item):
|
|||||||
|
|
||||||
def episodios(item):
|
def episodios(item):
|
||||||
itemlist = []
|
itemlist = []
|
||||||
json_file = current_session.get(item.url, headers=headers, params=payload).json()
|
if item.episodes:
|
||||||
for i, block in enumerate(json_file['data']):
|
episodes = item.episodes
|
||||||
if len(json_file['data']) > 1:
|
show_id = item.show_id
|
||||||
prepend = str(i + 1) + 'x'
|
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:
|
else:
|
||||||
prepend = 'Episodio '
|
episodes = json_file[0]['episodes']
|
||||||
show_id = str(block['show_id'])
|
show_id = str(json_file[0]['show_id'])
|
||||||
season_id = str(block['season_id'])
|
season_id = str(json_file[0]['season_id'])
|
||||||
episodes = []
|
|
||||||
support.info('SEASON ID= ',season_id)
|
|
||||||
for episode in json_file['data']:
|
for episode in episodes:
|
||||||
episodes.append(episode['episodes'])
|
try:
|
||||||
for episode in episodes:
|
title = 'Episodio ' + episode['number'] + ' - ' + episode['title'].encode('utf8')
|
||||||
for key in episode:
|
except:
|
||||||
if 'stagione' in encode(key['title']).lower():
|
title = 'Episodio ' + episode['number'] + ' - ' + episode['title']
|
||||||
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 type(title) == tuple: title = title[0]
|
||||||
if season and episode:
|
itemlist.append(
|
||||||
title = season + 'x' + episode + ' - ' + item.fulltitle
|
item.clone(title = support.typo(title, 'bold'),
|
||||||
make_item = True
|
url= host + show_id + '/season/' + str(season_id),
|
||||||
elif int(key['season_id']) == int(season_id):
|
action= 'findvideos',
|
||||||
try:
|
video_id= episode['video_id']))
|
||||||
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']))
|
|
||||||
if inspect.stack()[1][3] not in ['find_episodes']:
|
if inspect.stack()[1][3] not in ['find_episodes']:
|
||||||
autorenumber.start(itemlist, item)
|
autorenumber.start(itemlist, item)
|
||||||
if autorenumber.check(item) == True \
|
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,
|
otmdb_global = Tmdb(id_Tmdb=item.infoLabels['tmdb_id'], tipo=tipo_busqueda,
|
||||||
idioma_busqueda=idioma_busqueda)
|
idioma_busqueda=idioma_busqueda)
|
||||||
else:
|
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'])
|
idioma_busqueda=idioma_busqueda, year=item.infoLabels['year'])
|
||||||
|
|
||||||
__leer_datos(otmdb_global)
|
__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
|
# do it by title
|
||||||
if tipo_busqueda == 'tv':
|
if tipo_busqueda == 'tv':
|
||||||
# Serial search by title and filtering your results if necessary
|
# 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', {}),
|
idioma_busqueda=idioma_busqueda, filtro=item.infoLabels.get('filtro', {}),
|
||||||
year=item.infoLabels['year'])
|
year=item.infoLabels['year'])
|
||||||
else:
|
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']:
|
# if item.infoLabels['year'] or item.infoLabels['filtro']:
|
||||||
# ...and year or filter
|
# ...and year or filter
|
||||||
searched_title = item.contentTitle if item.contentTitle else item.fulltitle
|
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'])
|
filtro=item.infoLabels.get('filtro', {}), year=item.infoLabels['year'])
|
||||||
if otmdb is not None:
|
if otmdb is not None:
|
||||||
if otmdb.get_id() and config.get_setting("tmdb_plus_info", default=False):
|
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("tmdb_id") or not item.infoLabels.get("tmdb_id")[0].isdigit():
|
||||||
if not item.infoLabels.get("imdb_id"):
|
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:
|
else:
|
||||||
otmdb_global = Tmdb(external_id=item.infoLabels.get("imdb_id"), external_source="imdb_id", tipo=tipo_busqueda)
|
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']:
|
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")
|
path = filetools.join(config.get_data_path(), "settings_channels", item.channel + "_data.json")
|
||||||
if filetools.exists(path):
|
if filetools.exists(path):
|
||||||
g = jsontools.load(filetools.read(path)).get(RENUMBER,{}).get(item.fulltitle.strip(),{}).get(GROUP,'')
|
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)
|
groups = get_groups(item)
|
||||||
|
|
||||||
if groups:
|
if groups:
|
||||||
Id = select_group(groups, item)
|
Id = select_group(groups, item)
|
||||||
if Id == 'original':
|
if Id == 'original':
|
||||||
pass
|
info_nfo = ', '.join(item.infoLabels['url_scraper']) + "\n"
|
||||||
|
return info_nfo
|
||||||
elif Id :
|
elif Id :
|
||||||
info_nfo = 'https://www.themoviedb.org/tv/{}/episode_group/{}\n'.format(item.infoLabels['tmdb_id'], Id)
|
info_nfo = 'https://www.themoviedb.org/tv/{}/episode_group/{}\n'.format(item.infoLabels['tmdb_id'], Id)
|
||||||
return info_nfo
|
return info_nfo
|
||||||
|
|||||||
@@ -184,6 +184,28 @@ class autorenumber():
|
|||||||
itemlist = find_episodes(self.item)
|
itemlist = find_episodes(self.item)
|
||||||
busy(False)
|
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:
|
if self.item.renumber or self.manual:
|
||||||
self.item.renumber = False
|
self.item.renumber = False
|
||||||
self.season, self.episode, self.manual, self.specials, Manual, Exit = SelectreNumeration(self, itemlist)
|
self.season, self.episode, self.manual, self.specials, Manual, Exit = SelectreNumeration(self, itemlist)
|
||||||
@@ -194,32 +216,6 @@ class autorenumber():
|
|||||||
self.episodes = Manual
|
self.episodes = Manual
|
||||||
|
|
||||||
else:
|
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
|
firstep = 0
|
||||||
if self.season > 1:
|
if self.season > 1:
|
||||||
for c in range(1, self.season):
|
for c in range(1, self.season):
|
||||||
|
|||||||
Reference in New Issue
Block a user