Nasconde Aggiungi a Videoteca e Download
Se la serie non è rinumerata
This commit is contained in:
+12
-10
@@ -281,8 +281,8 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
|||||||
infoLabels=infolabels,
|
infoLabels=infolabels,
|
||||||
thumbnail=item.thumbnail if function == 'episodios' else scraped["thumb"] ,
|
thumbnail=item.thumbnail if function == 'episodios' else scraped["thumb"] ,
|
||||||
args=item.args,
|
args=item.args,
|
||||||
contentSerieName= title if item.contentType != 'movie' and function != 'episodios' else item.fulltitle if function == 'episodios' else '',
|
contentSerieName= title if item.contentType or CT != 'movie' and function != 'episodios' else item.fulltitle if function == 'episodios' else '',
|
||||||
contentTitle= title if item.contentType == 'movie' else '',
|
contentTitle= title if item.contentType or CT == 'movie' else '',
|
||||||
contentLanguage = lang,
|
contentLanguage = lang,
|
||||||
ep=episode if episode else ''
|
ep=episode if episode else ''
|
||||||
)
|
)
|
||||||
@@ -406,16 +406,18 @@ def scrape(func):
|
|||||||
if action != 'play' and function != 'episodios' and 'patronMenu' not in args:
|
if action != 'play' and function != 'episodios' and 'patronMenu' not in args:
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
|
|
||||||
if anime:
|
from specials import autorenumber
|
||||||
from specials import autorenumber
|
if anime:
|
||||||
if function == 'episodios' or item.action == 'episodios': autorenumber.renumber(itemlist, item, 'bold')
|
if function == 'episodios' or item.action == 'episodios': autorenumber.renumber(itemlist, item, 'bold')
|
||||||
else: autorenumber.renumber(itemlist)
|
else: autorenumber.renumber(itemlist)
|
||||||
|
if anime and autorenumber.check(item) == False:
|
||||||
if addVideolibrary and (item.infoLabels["title"] or item.fulltitle):
|
pass
|
||||||
# item.fulltitle = item.infoLabels["title"]
|
else:
|
||||||
videolibrary(itemlist, item, function=function)
|
if addVideolibrary and (item.infoLabels["title"] or item.fulltitle):
|
||||||
if config.get_setting('downloadenabled') and (function == 'episodios' or function == 'finvideos'):
|
# item.fulltitle = item.infoLabels["title"]
|
||||||
download(itemlist, item, function=function)
|
videolibrary(itemlist, item, function=function)
|
||||||
|
if config.get_setting('downloadenabled') and (function == 'episodios' or function == 'finvideos'):
|
||||||
|
download(itemlist, item, function=function)
|
||||||
|
|
||||||
if 'patronMenu' in args:
|
if 'patronMenu' in args:
|
||||||
itemlist = thumb(itemlist, genre=True)
|
itemlist = thumb(itemlist, genre=True)
|
||||||
|
|||||||
+48
-35
@@ -10,11 +10,11 @@ USO:
|
|||||||
|
|
||||||
3) Aggiungere le seguinti stringhe nel json del canale (per attivare la configurazione di autonumerazione del canale)
|
3) Aggiungere le seguinti stringhe nel json del canale (per attivare la configurazione di autonumerazione del canale)
|
||||||
{
|
{
|
||||||
"id": "autorenumber",
|
"id": "autorenumber",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"label": "@70712",
|
"label": "@70712",
|
||||||
"default": false,
|
"default": false,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"visible": true
|
"visible": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -72,7 +72,7 @@ def semiautomatic_config_item(item):
|
|||||||
item.channel = item.from_channel
|
item.channel = item.from_channel
|
||||||
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
|
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
|
||||||
title = item.show
|
title = item.show
|
||||||
|
|
||||||
# Trova l'ID dellla serie
|
# Trova l'ID dellla serie
|
||||||
while not item.infoLabels['tvdb_id']:
|
while not item.infoLabels['tvdb_id']:
|
||||||
try:
|
try:
|
||||||
@@ -83,7 +83,7 @@ def semiautomatic_config_item(item):
|
|||||||
info = platformtools.dialog_numeric(0, heading)
|
info = platformtools.dialog_numeric(0, heading)
|
||||||
item.infoLabels['tvdb_id'] = '0' if info == '' else info
|
item.infoLabels['tvdb_id'] = '0' if info == '' else info
|
||||||
|
|
||||||
|
|
||||||
if item.infoLabels['tvdb_id']:
|
if item.infoLabels['tvdb_id']:
|
||||||
ID = item.infoLabels['tvdb_id']
|
ID = item.infoLabels['tvdb_id']
|
||||||
dict_renumerate = {TAG_ID: ID}
|
dict_renumerate = {TAG_ID: ID}
|
||||||
@@ -101,7 +101,7 @@ def semiautomatic_config_item(item):
|
|||||||
heading = config.get_localized_string(70686) # <- Enter the number of the starting season (for season 1)
|
heading = config.get_localized_string(70686) # <- Enter the number of the starting season (for season 1)
|
||||||
season = platformtools.dialog_numeric(0, heading, '1')
|
season = platformtools.dialog_numeric(0, heading, '1')
|
||||||
dict_renumerate[TAG_SEASON] = season
|
dict_renumerate[TAG_SEASON] = season
|
||||||
|
|
||||||
########### PROVVISORIO ###################
|
########### PROVVISORIO ###################
|
||||||
mode = platformtools.dialog_yesno(config.get_localized_string(70687), config.get_localized_string(70688), nolabel=config.get_localized_string(30023), yeslabel=config.get_localized_string(30022))
|
mode = platformtools.dialog_yesno(config.get_localized_string(70687), config.get_localized_string(70688), nolabel=config.get_localized_string(30023), yeslabel=config.get_localized_string(30022))
|
||||||
if mode == 1:
|
if mode == 1:
|
||||||
@@ -119,7 +119,7 @@ def semiautomatic_config_item(item):
|
|||||||
# Richede se ci sono speciali nella stagione
|
# Richede se ci sono speciali nella stagione
|
||||||
# mode = platformtools.dialog_yesno(config.get_localized_string(70687), config.get_localized_string(70688), nolabel=config.get_localized_string(30023), yeslabel=config.get_localized_string(30022))
|
# mode = platformtools.dialog_yesno(config.get_localized_string(70687), config.get_localized_string(70688), nolabel=config.get_localized_string(30023), yeslabel=config.get_localized_string(30022))
|
||||||
# if mode == 0: dict_renumerate[TAG_MODE] = False
|
# if mode == 0: dict_renumerate[TAG_MODE] = False
|
||||||
# else:
|
# else:
|
||||||
# select = platformtools.dialog_yesno(config.get_localized_string(70687), config.get_localized_string(70717), nolabel=config.get_localized_string(30023), yeslabel=config.get_localized_string(30022))
|
# select = platformtools.dialog_yesno(config.get_localized_string(70687), config.get_localized_string(70717), nolabel=config.get_localized_string(30023), yeslabel=config.get_localized_string(30022))
|
||||||
# if select == 0:
|
# if select == 0:
|
||||||
# dict_renumerate[TAG_MODE] = False
|
# dict_renumerate[TAG_MODE] = False
|
||||||
@@ -146,7 +146,7 @@ def semiautomatic_config_item(item):
|
|||||||
message = config.get_localized_string(60444)
|
message = config.get_localized_string(60444)
|
||||||
heading = item.show.strip()
|
heading = item.show.strip()
|
||||||
platformtools.dialog_notification(heading, message)
|
platformtools.dialog_notification(heading, message)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def config_item(item, itemlist=[], typography='', active=False):
|
def config_item(item, itemlist=[], typography='', active=False):
|
||||||
@@ -157,15 +157,15 @@ def config_item(item, itemlist=[], typography='', active=False):
|
|||||||
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
|
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
|
||||||
try: ID = dict_series[item.show.rstrip()][TAG_ID]
|
try: ID = dict_series[item.show.rstrip()][TAG_ID]
|
||||||
except: ID = ''
|
except: ID = ''
|
||||||
|
|
||||||
# Pulizia del Titolo
|
# Pulizia del Titolo
|
||||||
if any( word in title.lower() for word in ['specials', 'speciali']):
|
if any( word in title.lower() for word in ['specials', 'speciali']):
|
||||||
item.show = re.sub(r'\sspecials|\sspeciali', '', item.show.lower())
|
item.show = re.sub(r'\sspecials|\sspeciali', '', item.show.lower())
|
||||||
log('ITEM SHOW= ',item.show)
|
log('ITEM SHOW= ',item.show)
|
||||||
tvdb.find_and_set_infoLabels(item)
|
tvdb.find_and_set_infoLabels(item)
|
||||||
elif not item.infoLabels['tvdb_id']:
|
elif not item.infoLabels['tvdb_id']:
|
||||||
item.show = title.rstrip('123456789 ')
|
item.show = title.rstrip('123456789 ')
|
||||||
tvdb.find_and_set_infoLabels(item)
|
tvdb.find_and_set_infoLabels(item)
|
||||||
|
|
||||||
if not ID and active:
|
if not ID and active:
|
||||||
if item.infoLabels['tvdb_id']:
|
if item.infoLabels['tvdb_id']:
|
||||||
@@ -197,17 +197,17 @@ def renumber(itemlist, item='', typography=''):
|
|||||||
# Seleziona la funzione Adatta, Menu Contestuale o Rinumerazione
|
# Seleziona la funzione Adatta, Menu Contestuale o Rinumerazione
|
||||||
if item:
|
if item:
|
||||||
settings_node = jsontools.get_node_from_file(item.channel, 'settings')
|
settings_node = jsontools.get_node_from_file(item.channel, 'settings')
|
||||||
# Controlla se la Serie è già stata rinumerata
|
# Controlla se la Serie è già stata rinumerata
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
|
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
|
||||||
TITLE = item.fulltitle.rstrip()
|
TITLE = item.fulltitle.rstrip()
|
||||||
ID = dict_series[TITLE][TAG_ID]
|
ID = dict_series[TITLE][TAG_ID]
|
||||||
|
|
||||||
exist = True
|
exist = True
|
||||||
except:
|
except:
|
||||||
exist = False
|
exist = False
|
||||||
|
|
||||||
if exist:
|
if exist:
|
||||||
ID = dict_series[TITLE][TAG_ID]
|
ID = dict_series[TITLE][TAG_ID]
|
||||||
SEASON = dict_series[TITLE][TAG_SEASON]
|
SEASON = dict_series[TITLE][TAG_SEASON]
|
||||||
@@ -225,7 +225,7 @@ def renumber(itemlist, item='', typography=''):
|
|||||||
dict_series = jsontools.get_node_from_file(itemlist[0].channel, TAG_TVSHOW_RENUMERATE)
|
dict_series = jsontools.get_node_from_file(itemlist[0].channel, TAG_TVSHOW_RENUMERATE)
|
||||||
TITLE = item.show.rstrip()
|
TITLE = item.show.rstrip()
|
||||||
ID = dict_series[TITLE][TAG_ID]
|
ID = dict_series[TITLE][TAG_ID]
|
||||||
exist = True
|
exist = True
|
||||||
except:
|
except:
|
||||||
exist = False
|
exist = False
|
||||||
if item.contentType != 'movie':
|
if item.contentType != 'movie':
|
||||||
@@ -236,7 +236,7 @@ def renumber(itemlist, item='', typography=''):
|
|||||||
else:
|
else:
|
||||||
item.show = TITLE
|
item.show = TITLE
|
||||||
item.context = context(exist)
|
item.context = context(exist)
|
||||||
|
|
||||||
def renumeration (itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE):
|
def renumeration (itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE):
|
||||||
log()
|
log()
|
||||||
# Se ID è 0 salta la rinumerazione
|
# Se ID è 0 salta la rinumerazione
|
||||||
@@ -249,10 +249,10 @@ def renumeration (itemlist, item, typography, dict_series, ID, SEASON, EPISODE,
|
|||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
number = scrapertoolsV2.find_single_match(item.title, r'\d+')
|
number = scrapertoolsV2.find_single_match(item.title, r'\d+')
|
||||||
item.title = typo('0x' + number + ' - ', typography) + item.title
|
item.title = typo('0x' + number + ' - ', typography) + item.title
|
||||||
|
|
||||||
|
|
||||||
# Usa la lista degli Episodi se esiste nel Json
|
# Usa la lista degli Episodi se esiste nel Json
|
||||||
|
|
||||||
elif EPISODE:
|
elif EPISODE:
|
||||||
EpisodeDict = json.loads(base64.b64decode(EPISODE))
|
EpisodeDict = json.loads(base64.b64decode(EPISODE))
|
||||||
|
|
||||||
@@ -264,7 +264,7 @@ def renumeration (itemlist, item, typography, dict_series, ID, SEASON, EPISODE,
|
|||||||
number = scrapertoolsV2.find_single_match(item.title, r'\d+').lstrip("0")
|
number = scrapertoolsV2.find_single_match(item.title, r'\d+').lstrip("0")
|
||||||
item.title = typo(EpisodeDict[str(number)] + ' - ', typography) + item.title
|
item.title = typo(EpisodeDict[str(number)] + ' - ', typography) + item.title
|
||||||
else:
|
else:
|
||||||
make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE)
|
make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE)
|
make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE)
|
||||||
@@ -281,7 +281,7 @@ def make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE
|
|||||||
FirstOfSeason= 0
|
FirstOfSeason= 0
|
||||||
try: SPECIAL = dict_series[TITLE][TAG_SPECIAL]
|
try: SPECIAL = dict_series[TITLE][TAG_SPECIAL]
|
||||||
except: SPECIAL = []
|
except: SPECIAL = []
|
||||||
|
|
||||||
# Ricava Informazioni da TVDB
|
# Ricava Informazioni da TVDB
|
||||||
while exist:
|
while exist:
|
||||||
data = tvdb.otvdb_global.get_list_episodes(ID,page)
|
data = tvdb.otvdb_global.get_list_episodes(ID,page)
|
||||||
@@ -293,7 +293,7 @@ def make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE
|
|||||||
EpList.append([episodes['firstAired'], episodes['airedSeason'], episodes['airedEpisodeNumber']])
|
EpList.append([episodes['firstAired'], episodes['airedSeason'], episodes['airedEpisodeNumber']])
|
||||||
EpList.sort()
|
EpList.sort()
|
||||||
log(EpList)
|
log(EpList)
|
||||||
|
|
||||||
# Crea Dizionari per la numerazione
|
# Crea Dizionari per la numerazione
|
||||||
if EpList:
|
if EpList:
|
||||||
specials = []
|
specials = []
|
||||||
@@ -311,7 +311,7 @@ def make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE
|
|||||||
regular[ep] = [str(episode[1]) + 'x' + str(episode[2]), str(episode[0]), allep - 1]
|
regular[ep] = [str(episode[1]) + 'x' + str(episode[2]), str(episode[0]), allep - 1]
|
||||||
ep = ep + 1
|
ep = ep + 1
|
||||||
allep = allep + 1
|
allep = allep + 1
|
||||||
|
|
||||||
# seleziona l'Episodio di partenza
|
# seleziona l'Episodio di partenza
|
||||||
if int(SEASON) > 1:
|
if int(SEASON) > 1:
|
||||||
for numbers, data in regular.items():
|
for numbers, data in regular.items():
|
||||||
@@ -322,7 +322,7 @@ def make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE
|
|||||||
log(SPECIAL)
|
log(SPECIAL)
|
||||||
log(complete)
|
log(complete)
|
||||||
log(regular)
|
log(regular)
|
||||||
|
|
||||||
addiction = 0
|
addiction = 0
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
# Otiene Numerazione Episodi
|
# Otiene Numerazione Episodi
|
||||||
@@ -333,7 +333,7 @@ def make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE
|
|||||||
# find = episode + FirstOfSeason
|
# find = episode + FirstOfSeason
|
||||||
# log('FIND= ',find, ' ',str(episode) + ' ' + str(FirstOfSeason))
|
# log('FIND= ',find, ' ',str(episode) + ' ' + str(FirstOfSeason))
|
||||||
# Crea Dizionario Episodi
|
# Crea Dizionario Episodi
|
||||||
|
|
||||||
# log(episode, ' ', number, ' ', count)
|
# log(episode, ' ', number, ' ', count)
|
||||||
if episode == 0:
|
if episode == 0:
|
||||||
EpisodeDict[str(episode)] = str(complete[regular[FirstOfSeason+1][2]][0])
|
EpisodeDict[str(episode)] = str(complete[regular[FirstOfSeason+1][2]][0])
|
||||||
@@ -351,14 +351,14 @@ def make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE
|
|||||||
except: EpisodeDict[str(episode)] = '0x0'
|
except: EpisodeDict[str(episode)] = '0x0'
|
||||||
|
|
||||||
# Aggiunge numerazione agli Episodi
|
# Aggiunge numerazione agli Episodi
|
||||||
|
|
||||||
item.title = typo(EpisodeDict[str(episode)] + ' - ', typography) + item.title
|
item.title = typo(EpisodeDict[str(episode)] + ' - ', typography) + item.title
|
||||||
|
|
||||||
# Scrive Dizionario Episodi sul json
|
# Scrive Dizionario Episodi sul json
|
||||||
EpisodeDict = base64.b64encode(json.dumps(EpisodeDict))
|
EpisodeDict = base64.b64encode(json.dumps(EpisodeDict))
|
||||||
dict_series[TITLE][TAG_EPISODE] = EpisodeDict
|
dict_series[TITLE][TAG_EPISODE] = EpisodeDict
|
||||||
jsontools.update_node(dict_series, item.channel, TAG_TVSHOW_RENUMERATE)[0]
|
jsontools.update_node(dict_series, item.channel, TAG_TVSHOW_RENUMERATE)[0]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
heading = config.get_localized_string(70704)
|
heading = config.get_localized_string(70704)
|
||||||
ID = platformtools.dialog_numeric(0, heading)
|
ID = platformtools.dialog_numeric(0, heading)
|
||||||
@@ -370,13 +370,13 @@ def make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE
|
|||||||
return make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE)
|
return make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE)
|
||||||
|
|
||||||
# return itemlist
|
# return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def RepresentsInt(s):
|
def RepresentsInt(s):
|
||||||
# Controllo Numro Stagione
|
# Controllo Numro Stagione
|
||||||
log()
|
log()
|
||||||
try:
|
try:
|
||||||
int(s)
|
int(s)
|
||||||
return True
|
return True
|
||||||
except ValueError:
|
except ValueError:
|
||||||
@@ -387,3 +387,16 @@ def error(itemlist):
|
|||||||
heading = itemlist[0].fulltitle.strip()
|
heading = itemlist[0].fulltitle.strip()
|
||||||
platformtools.dialog_notification(heading, message)
|
platformtools.dialog_notification(heading, message)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
def check(item):
|
||||||
|
try:
|
||||||
|
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
|
||||||
|
TITLE = item.fulltitle.rstrip()
|
||||||
|
ID = dict_series[TITLE][TAG_ID]
|
||||||
|
SEASON = dict_series[TITLE][TAG_SEASON]
|
||||||
|
EPISODE = dict_series[TITLE][TAG_EPISODE]
|
||||||
|
MODE = dict_series[TITLE][TAG_MODE]
|
||||||
|
exist = True
|
||||||
|
except:
|
||||||
|
exist = False
|
||||||
|
return exist
|
||||||
|
|||||||
Reference in New Issue
Block a user