.
diff --git a/channels/animeworld.json b/channels/animeworld.json
index 44dc8d9e..6d619898 100644
--- a/channels/animeworld.json
+++ b/channels/animeworld.json
@@ -3,7 +3,7 @@
"name": "AnimeWorld",
"active": true,
"adult": false,
- "language": ["ita", "vos"],
+ "language": ["ita", "vosi"],
"thumbnail": "animeworld.png",
"banner": "animeworld.png",
"categories": ["anime", "vos"],
diff --git a/channels/animeworld.py b/channels/animeworld.py
index 2350436e..f810fb02 100644
--- a/channels/animeworld.py
+++ b/channels/animeworld.py
@@ -124,9 +124,10 @@ def peliculas(item):
@support.scrape
def episodios(item):
anime=True
+ pagination = 50
data = support.match(item, headers=headers)[1]
if 'VVVVID' in data: patronBlock= r'.*?)'
- else: patronblock= 'server active(?P
.*?)server hidden'
+ else: patronBlock= r'server active(?P.*?)server hidden '
patron = r']+>(?P[^<]+)<'
def itemHook(item):
item.title += support.typo(item.fulltitle,'-- bold')
diff --git a/channels/vvvvid.py b/channels/vvvvid.py
index d4ef68ec..be023b89 100644
--- a/channels/vvvvid.py
+++ b/channels/vvvvid.py
@@ -125,6 +125,7 @@ def episodios(item):
title = match[0]+'x'+match[1] + ' - ' + item.fulltitle
else:
title = 'Episodio ' + key['number'].encode('ascii', 'replace') + ' - ' + key['title'],
+ if type(title) == tuple: title = title[0]
itemlist.append(
Item(
channel = item.channel,
@@ -164,7 +165,7 @@ def findvideos(item):
url= 'https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/' + url,
server= 'directo')
)
- return support.server(item, itemlist=itemlist, download=False)
+ return support.server(item, itemlist=itemlist, down_load=False)
def make_itemlist(itemlist, item, data):
search = item.search if item.search else ''
@@ -185,7 +186,6 @@ def make_itemlist(itemlist, item, data):
contentType = item.contentType,
contentSerieName= key['title'] if item.contentType != 'movie' else '',
contentTitle= key['title'] if item.contentType == 'movie' else '',
- thumbnail= key['thumbnail'],
infoLabels=infoLabels
))
return itemlist
\ No newline at end of file
diff --git a/core/channeltools.py b/core/channeltools.py
index 64396b91..4c82b616 100644
--- a/core/channeltools.py
+++ b/core/channeltools.py
@@ -227,40 +227,48 @@ def get_default_settings(channel_name):
default_controls = jsontools.load(filetools.read(default_path)).get('settings', list())
default_controls_renumber = jsontools.load(filetools.read(default_path)).get('renumber', list())
categories = get_channel_json(channel_name).get('categories', list())
+ not_active = get_channel_json(channel_name).get('not_active', list())
+ default_off = get_channel_json(channel_name).get('default_off', list())
# Apply default configurations if they do not exist
for control in default_controls:
if control['id'] not in str(channel_controls):
- if 'include_in_newest' in control['id']:
+ if 'include_in_newest' in control['id'] and 'include_in_newest' not in not_active:
label = control['id'].split('_')
label = label[-1]
if label == 'peliculas':
if 'movie' in categories:
control['label'] = config.get_localized_string(70727) + ' - ' + config.get_localized_string(30122)
+ control['default'] = True if 'include_in_newest' not in default_off else False
channel_controls.append(control)
else: pass
elif label == 'series':
if 'tvshow' in categories:
control['label'] = config.get_localized_string(70727) + ' - ' + config.get_localized_string(30123)
+ control['default'] = True if 'include_in_newest' not in default_off else False
channel_controls.append(control)
else: pass
elif label == 'anime':
if 'anime' in categories:
control['label'] = config.get_localized_string(70727) + ' - ' + config.get_localized_string(30124)
+ control['default'] = True if 'include_in_newest' not in default_off else False
channel_controls.append(control)
else: pass
else:
control['label'] = config.get_localized_string(70727) + ' - ' + label.capitalize()
+ control['default'] = True if control['id'] not in default_off else False
channel_controls.append(control)
- elif control['id'] == 'filter_languages':
- if len(channel_language) > 1:
- control['lvalues'] = list_language
- channel_controls.append(control)
- else: pass
+ # elif control['id'] == 'filter_languages':
+ # if len(channel_language) > 1:
+ # control['lvalues'] = list_language
+ # channel_controls.append(control)
+ # else: pass
- else:
+ elif control['id'] not in not_active:
+ if type(control['default']) == bool:
+ control['default'] = True if control['id'] not in default_off else False
channel_controls.append(control)
if renumber:
diff --git a/core/support.py b/core/support.py
index c20939f6..8d074590 100644
--- a/core/support.py
+++ b/core/support.py
@@ -323,7 +323,7 @@ def scrape(func):
itemlist = []
args = func(*args)
- log('STACK= ',inspect.stack()[1][3])
+ # log('STACK= ',inspect.stack()[1][3])
item = args['item']
@@ -345,7 +345,8 @@ def scrape(func):
typeActionDict = args['type_action_dict'] if 'type_action_dict' in args else {}
typeContentDict = args['type_content_dict'] if 'type_content_dict' in args else {}
debug = args['debug'] if 'debug' in args else False
- if 'pagination' in args and inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes']: pagination = args['pagination'] if args['pagination'] else 20
+ log('STACK= ', inspect.stack()[1][3])
+ if 'pagination' in args and inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'manual_renumeration']: pagination = args['pagination'] if args['pagination'] else 20
else: pagination = ''
lang = args['deflang'] if 'deflang' in args else ''
pag = item.page if item.page else 1 # pagination
@@ -772,7 +773,7 @@ def download(itemlist, item, typography='', function_level=1, function=''):
if itemlist and item.contentChannel != 'videolibrary':
itemlist.append(
Item(channel='downloads',
- fromchannel=item.channel,
+ from_channel=item.channel,
title=title,
fulltitle=item.fulltitle,
show=item.fulltitle,
@@ -786,7 +787,7 @@ def download(itemlist, item, typography='', function_level=1, function=''):
if fromaction == 'episodios':
itemlist.append(
Item(channel='downloads',
- fromchannel=item.channel,
+ from_channel=item.channel,
title=typo(config.get_localized_string(60357),typography),
fulltitle=item.fulltitle,
show=item.fulltitle,
@@ -879,7 +880,7 @@ def pagination(itemlist, item, page, perpage, function_level=1):
thumbnail=thumb()))
return itemlist
-def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True):#, down_load=True):
+def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True, down_load=True):
if not data:
data = httptools.downloadpage(item.url, headers=headers, ignore_response_code=True).data
@@ -897,7 +898,7 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
videoitem.channel = item.channel
videoitem.contentType = item.contentType
- return controls(itemlist, item, AutoPlay, CheckLinks)
+ return controls(itemlist, item, AutoPlay, CheckLinks, down_load)
def controls(itemlist, item, AutoPlay=True, CheckLinks=True, down_load=True):
from core import jsontools
diff --git a/default_channel_settings.json b/default_channel_settings.json
index f24134ae..911bd098 100644
--- a/default_channel_settings.json
+++ b/default_channel_settings.json
@@ -56,15 +56,6 @@
"enabled": true,
"visible": "eq(-1,true)",
"lvalues": [ "3", "5", "10", "15", "20" ]
- },
- {
- "id": "filter_languages",
- "type": "list",
- "label": "@30019",
- "default": 0,
- "enabled": true,
- "visible": true,
- "lvalues": ["Non Filtrare"]
}
],
@@ -76,14 +67,6 @@
"default": false,
"enabled": true,
"visible": true
- },
- {
- "id": "autorenumber_mode",
- "type": "bool",
- "label": "@70688",
- "default": false,
- "enabled": true,
- "visible": "eq(-1,true)"
}
]
}
diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py
index 65e312c1..65188d2c 100644
--- a/platformcode/platformtools.py
+++ b/platformcode/platformtools.py
@@ -584,8 +584,10 @@ def set_context_commands(item, parent_item):
action="set_custom_start",
parent=item.tourl()).tourl())))
- if item.channel != "videolibrary":
+ if (item.channel != "videolibrary" and not config.get_localized_string(70585) in str(item.context)) \
+ or (item.channel != "videolibrary" and config.get_localized_string(70585) in str(item.context) and config.get_localized_string(70714) in str(item.context)):
# Añadir Serie a la videoteca
+ logger.info('context= '+ str(item.context))
if item.action in ["episodios", "get_episodios"] and item.contentSerieName:
context_commands.append((config.get_localized_string(60352), "XBMC.RunPlugin(%s?%s)" %
(sys.argv[0], item.clone(action="add_serie_to_library",
@@ -596,7 +598,8 @@ def set_context_commands(item, parent_item):
(sys.argv[0], item.clone(action="add_pelicula_to_library",
from_action=item.action).tourl())))
- if item.channel != "downloads" and item.channel != "videolibrary" and downloadenabled != "false":
+ if (item.channel != "downloads" and item.channel != "videolibrary" and downloadenabled != "false" and not config.get_localized_string(70585) in str(item.context))\
+ or (item.channel != "downloads" and item.channel != "videolibrary" and downloadenabled != "false" and config.get_localized_string(70585) in str(item.context) and config.get_localized_string(70714) in str(item.context)):
# Descargar pelicula
if item.contentType == "movie":
context_commands.append((config.get_localized_string(60354), "XBMC.RunPlugin(%s?%s)" %
diff --git a/resources/language/English/strings.po b/resources/language/English/strings.po
index f3b6adf2..216ad38a 100644
--- a/resources/language/English/strings.po
+++ b/resources/language/English/strings.po
@@ -5636,3 +5636,27 @@ msgstr ""
msgctxt "#70729"
msgid "Always add the highest quality"
msgstr ""
+
+msgctxt "#70730"
+msgid ""
+msgstr "Seleziona il metodo di rinumerazione"
+
+msgctxt "#70731"
+msgid ""
+msgstr "Semi-Automatico"
+
+msgctxt "#70732"
+msgid ""
+msgstr "Manuale"
+
+msgctxt "#70733"
+msgid ""
+msgstr "Digita il numero della Serie"
+
+msgctxt "#70734"
+msgid ""
+msgstr "Seleziona gli Episodi della Serie %s"
+
+msgctxt "#70735"
+msgid ""
+msgstr "Numero dell'Episodio Speciale"
diff --git a/resources/language/Italian/strings.po b/resources/language/Italian/strings.po
index 1a393788..34210042 100644
--- a/resources/language/Italian/strings.po
+++ b/resources/language/Italian/strings.po
@@ -5636,3 +5636,27 @@ msgstr "Includi in Ricerca Globale"
msgctxt "#70729"
msgid "Always add the highest quality"
msgstr "Aggiungi sempre la qualità più alta"
+
+msgctxt "#70730"
+msgid "Select the renumbering method"
+msgstr "Seleziona il metodo di rinumerazione"
+
+msgctxt "#70731"
+msgid "Semi-Automatic"
+msgstr "Semi-Automatico"
+
+msgctxt "#70732"
+msgid "Manual"
+msgstr "Manuale"
+
+msgctxt "#70733"
+msgid "Enter the Series number"
+msgstr "Digita il numero della Serie"
+
+msgctxt "#70734"
+msgid "Select Series %s Episodes"
+msgstr "Seleziona gli Episodi della Serie %s"
+
+msgctxt "#70735"
+msgid "%s Special Episode Number"
+msgstr "Numero dell'Episodio Speciale"
diff --git a/specials/autorenumber.py b/specials/autorenumber.py
index 34120da6..d3c02dce 100644
--- a/specials/autorenumber.py
+++ b/specials/autorenumber.py
@@ -31,10 +31,10 @@ try:
import xbmcgui
except:
xbmcgui = None
-
+import xbmc
import re, base64, json, os
from core import jsontools, tvdb, scrapertoolsV2
-from core.support import typo, log
+from core.support import typo, log, dbg
from platformcode import config, platformtools, logger
from platformcode.config import get_setting
@@ -44,6 +44,10 @@ TAG_SEASON = "Season"
TAG_EPISODE = "Episode"
TAG_SPECIAL = "Special"
TAG_MODE = "Mode"
+TAG_EPLIST = "EpList"
+TAG_CHECK = "ReCheck"
+TAG_SPLIST = "SpList"
+TAG_TYPE = "Type"
__channel__ = "autorenumber"
@@ -59,11 +63,77 @@ def context(exist):
if access():
modify = config.get_localized_string(70714) if exist else ''
_context = [{"title": typo(modify + config.get_localized_string(70585), 'bold'),
- "action": "semiautomatic_config_item",
- "channel": "autorenumber"}]
+ "action": "select_type",
+ "channel": "autorenumber",}]
return _context
+def select_type(item):
+ select = platformtools.dialog_select(config.get_localized_string(70730),[config.get_localized_string(70731), config.get_localized_string(70732)])
+ if select == 0: semiautomatic_config_item(item)
+ else: manual_renumeration(item)
+
+def manual_renumeration(item):
+ log()
+ _list = []
+ EpisodeDict = {}
+ item.channel = item.from_channel
+ title = item.show if item.show else item.fulltitle
+ dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
+ dict_series[title] = {}
+ dict_series[title][TAG_TYPE] = 'manual'
+ jsontools.update_node(dict_series, item.channel, TAG_TVSHOW_RENUMERATE)[0]
+ tvdb.find_and_set_infoLabels(item)
+
+ # Trova l'ID della serie
+ while not item.infoLabels['tvdb_id']:
+ try:
+ item.show = platformtools.dialog_input(default=item.show, heading=config.get_localized_string(30112)) # <- Enter title to search
+ tvdb.find_and_set_infoLabels(item)
+ except:
+ heading = config.get_localized_string(70704) # <- TMDB ID (0 to cancel)
+ info = platformtools.dialog_numeric(0, heading)
+ item.infoLabels['tvdb_id'] = '0' if info == '' else info
+
+ if item.infoLabels['tvdb_id']:
+ ID = item.infoLabels['tvdb_id']
+ dict_renumerate = {TAG_ID: ID}
+ dict_series[title] = dict_renumerate
+
+ channel = __import__('channels.' + item.channel, fromlist=["channels.%s" % item.channel])
+ itemlist = channel.episodios(item)
+ for item in itemlist:
+ Title = re.sub(r'\d+x\d+ - ', '', item.title)
+ if item.action == 'findvideos':
+ _list.append(Title)
+
+ count = 1
+ while len(_list) > 0:
+ season = platformtools.dialog_numeric(0, config.get_localized_string(70733))
+ selected = platformtools.dialog_multiselect(config.get_localized_string(70734) % season, _list)
+ if selected == None: break
+ for select in selected:
+ ep = scrapertoolsV2.find_single_match(_list[select], r'(\d+)')
+ if season == '0':
+ episode = ''
+ while not episode:
+ episode = platformtools.dialog_numeric(0, config.get_localized_string(70735) % _list[select] )
+ EpisodeDict[ep] = '%sx%s' %(season, episode.zfill(2))
+ else:
+ EpisodeDict[ep] = '%sx%s' %(season, str(count).zfill(2))
+ count += 1
+
+ for select in reversed(selected):
+ del _list[select]
+ if len(_list) == 0:
+ EpisodeDict = base64.b64encode(json.dumps(EpisodeDict))
+ dict_series[title][TAG_EPISODE] = EpisodeDict
+ else:
+ dict_series[title] = {}
+ jsontools.update_node(dict_series, item.channel, TAG_TVSHOW_RENUMERATE)[0]
+ xbmc.executebuiltin("Container.Refresh")
+
+
def semiautomatic_config_item(item):
log()
# Configurazione Semi Automatica, utile in caso la numerazione automatica fallisca
@@ -73,7 +143,7 @@ def semiautomatic_config_item(item):
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
title = item.show
- # Trova l'ID dellla serie
+ # Trova l'ID della serie
while not item.infoLabels['tvdb_id']:
try:
item.show = platformtools.dialog_input(default=item.show, heading=config.get_localized_string(30112)) # <- Enter title to search
@@ -102,9 +172,9 @@ def semiautomatic_config_item(item):
season = platformtools.dialog_numeric(0, heading, '1')
dict_renumerate[TAG_SEASON] = season
- ########### 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))
- if mode == 1:
+ if mode == True:
dict_renumerate[TAG_MODE] = False
specials = []
stop = False
@@ -116,31 +186,13 @@ def semiautomatic_config_item(item):
dict_renumerate[TAG_SPECIAL] = specials
else: stop = True
dict_renumerate[TAG_MODE] = False
- # 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))
- # if mode == 0: dict_renumerate[TAG_MODE] = False
- # 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))
- # if select == 0:
- # dict_renumerate[TAG_MODE] = False
- # specials = []
- # stop = False
- # while not stop:
- # heading = config.get_localized_string(70718) + str(specials)
- # special = platformtools.dialog_numeric(0, heading, '')
- # if special:
- # specials.append(int(special))
- # dict_renumerate[TAG_SPECIAL] = specials
- # else: stop = True
- # else:
- # dict_renumerate[TAG_MODE] = True
- ########### PROVVISORIO ###################
-
+ dict_renumerate[TAG_TYPE] = 'auto'
# Imposta la voce Episode
dict_renumerate[TAG_EPISODE] = ''
# Scrive nel json
jsontools.update_node(dict_series, item.channel, TAG_TVSHOW_RENUMERATE)[0]
+ xbmc.executebuiltin("Container.Refresh")
else:
message = config.get_localized_string(60444)
@@ -148,7 +200,6 @@ def semiautomatic_config_item(item):
platformtools.dialog_notification(heading, message)
-
def config_item(item, itemlist=[], typography='', active=False):
log()
# Configurazione Automatica, Tenta la numerazione Automatica degli episodi
@@ -161,7 +212,6 @@ def config_item(item, itemlist=[], typography='', active=False):
# Pulizia del Titolo
if any( word in title.lower() for word in ['specials', 'speciali']):
item.show = re.sub(r'\sspecials|\sspeciali', '', item.show.lower())
- log('ITEM SHOW= ',item.show)
tvdb.find_and_set_infoLabels(item)
elif not item.infoLabels['tvdb_id']:
item.show = title.rstrip('123456789 ')
@@ -192,42 +242,55 @@ def config_item(item, itemlist=[], typography='', active=False):
def renumber(itemlist, item='', typography=''):
log()
- if 'fromchannel' in item:
- item.channel = item.fromchannel if item.fromchannel else item.channel
+ # Carica Impostazioni
+ settings_node = jsontools.get_node_from_file(itemlist[0].channel, 'settings')
+ try: dict_series = jsontools.get_node_from_file(itemlist[0].channel, TAG_TVSHOW_RENUMERATE)
+ except: dict_series = {}
+
# Seleziona la funzione Adatta, Menu Contestuale o Rinumerazione
if item:
- settings_node = jsontools.get_node_from_file(item.channel, 'settings')
+ if 'from_channel' in item:
+ item.channel = item.from_channel if item.from_channel else item.channel
# Controlla se la Serie è già stata rinumerata
+ TITLE = item.fulltitle.rstrip() if item.fulltitle else item.contentTitle
+ if dict_series[TITLE].has_key(TAG_TYPE):
+ TYPE = dict_series[TITLE][TAG_TYPE]
+ else:
+ TYPE = 'auto'
+ dict_series[TITLE][TAG_TYPE] = TYPE
+ jsontools.update_node(dict_series, item.channel, TAG_TVSHOW_RENUMERATE)[0]
- try:
- dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
- TITLE = item.fulltitle.rstrip()
+ if TYPE == 'manual':
+ return itemlist
+
+ elif dict_series.has_key(TITLE) and dict_series[TITLE].has_key(TAG_ID):
ID = dict_series[TITLE][TAG_ID]
-
- exist = True
- except:
- exist = False
-
- if exist:
- ID = dict_series[TITLE][TAG_ID]
- SEASON = dict_series[TITLE][TAG_SEASON]
EPISODE = dict_series[TITLE][TAG_EPISODE]
- MODE = dict_series[TITLE][TAG_MODE]
+
+ if dict_series[TITLE].has_key(TAG_SEASON): SEASON = dict_series[TITLE][TAG_SEASON]
+ else: SEASON = ''
+
+ if dict_series[TITLE].has_key(TAG_MODE): MODE = dict_series[TITLE][TAG_MODE]
+ else: MODE = False
+
renumeration(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE)
+
else:
# se non è stata rinumerata controlla se è attiva la rinumerazione automatica
- if 'autorenumber' not in settings_node: return itemlist
+ if 'autorenumber' not in settings_node:
+ return itemlist
if settings_node['autorenumber'] == True:
- config_item(item, itemlist, typography, True)
+ config_item(item, itemlist, typography, True)
+
else:
for item in itemlist:
- try:
- dict_series = jsontools.get_node_from_file(itemlist[0].channel, TAG_TVSHOW_RENUMERATE)
- TITLE = item.show.rstrip()
+ TITLE = item.show.rstrip()
+ if dict_series.has_key(TITLE) and dict_series[TITLE].has_key(TAG_ID):
ID = dict_series[TITLE][TAG_ID]
exist = True
- except:
+ else:
exist = False
+
if item.contentType != 'movie':
if item.context:
context2 = item.context
@@ -238,7 +301,7 @@ def renumber(itemlist, item='', typography=''):
item.context = context(exist)
def renumeration (itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE):
- log('EPISODE= ', EPISODE)
+
# Se ID è 0 salta la rinumerazione
if ID == '0':
return itemlist
@@ -256,7 +319,6 @@ def renumeration (itemlist, item, typography, dict_series, ID, SEASON, EPISODE,
elif EPISODE:
EpisodeDict = json.loads(base64.b64decode(EPISODE))
- log('EPISODE DICT= ', EpisodeDict)
# Controlla che la lista egli Episodi sia della stessa lunghezza di Itemlist
if EpisodeDict == 'none':
@@ -274,35 +336,59 @@ def renumeration (itemlist, item, typography, dict_series, ID, SEASON, EPISODE,
make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE)
def make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE):
- from core import support
log()
- page = 1
- EpList = []
- if EPISODE:
- EpisodeDict = json.loads(base64.b64decode(EPISODE))
- else:
- EpisodeDict = {}
exist = True
item.infoLabels['tvdb_id'] = ID
tvdb.set_infoLabels_item(item)
FirstOfSeason= 0
+
+ if EPISODE: EpisodeDict = json.loads(base64.b64decode(EPISODE))
+ else: EpisodeDict = {}
try: SPECIAL = dict_series[TITLE][TAG_SPECIAL]
except: SPECIAL = []
+ try: EpList = json.loads(base64.b64decode(dict_series[TITLE][TAG_EPLIST]))
+ except: EpList = []
+ try: Pages = dict_series[TITLE][TAG_CHECK]
+ except: Pages = [1]
# Ricava Informazioni da TVDB
- while exist:
- data = tvdb.otvdb_global.get_list_episodes(ID,page)
- if data: page = page + 1
- else: exist = False
+ checkpages = []
+ check = True
+ Page = Pages[-1]
+ while exist:
+ if check:
+ for page in Pages:
+ data = tvdb.otvdb_global.get_list_episodes(ID,page)
+ for episodes in data['data']:
+ if episodes['firstAired'] and [episodes['firstAired'], episodes['airedSeason'], episodes['airedEpisodeNumber']] not in EpList:
+ EpList.append([episodes['firstAired'], episodes['airedSeason'], episodes['airedEpisodeNumber']])
+ else:
+ if page not in checkpages:
+ checkpages.append(page)
+ check = False
+
+ data = tvdb.otvdb_global.get_list_episodes(ID,Page)
if data:
+ Page = Page + 1
for episodes in data['data']:
- if episodes['firstAired']: EpList.append([episodes['firstAired'], episodes['airedSeason'], episodes['airedEpisodeNumber']])
- EpList.sort()
- log(EpList)
+ if episodes['firstAired'] and [episodes['firstAired'], episodes['airedSeason'], episodes['airedEpisodeNumber']] not in EpList:
+ EpList.append([episodes['firstAired'], episodes['airedSeason'], episodes['airedEpisodeNumber']])
+ else:
+ if page not in checkpages:
+ checkpages.append(Page -1)
+ exist = False
+
+ EpList.sort()
+
+ dict_series[TITLE][TAG_CHECK] = checkpages
+ EpList = base64.b64encode(json.dumps(EpList))
+ dict_series[TITLE][TAG_EPLIST] = EpList
+ jsontools.update_node(dict_series, item.channel, TAG_TVSHOW_RENUMERATE)[0]
# Crea Dizionari per la numerazione
if EpList:
+ EpList = json.loads(base64.b64decode(dict_series[TITLE][TAG_EPLIST]))
specials = []
regular = {}
complete = {}
@@ -310,7 +396,6 @@ def make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE
ep = 1
specialep = 0
for episode in EpList:
- log('EPISODE= ', episode[1])
complete[allep] = [str(episode[1]) + 'x' + str(episode[2]), episode[0]]
if episode[1] == 0:
specials.append(allep)
@@ -327,20 +412,14 @@ def make_list(itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE
FirstOfSeason = numbers - 1
if MODE == True: SPECIAL = specials
- log(SPECIAL)
- log(complete)
- log(regular)
addiction = 0
for item in itemlist:
# Otiene Numerazione Episodi
if config.get_localized_string(30992) not in item.title:
episode = int(scrapertoolsV2.find_single_match(item.title, r'\d+'))
- log('EPISODE= ',episode)
number = episode + FirstOfSeason - addiction
count = number + addiction
- # find = episode + FirstOfSeason
- # log('FIND= ',find, ' ',str(episode) + ' ' + str(FirstOfSeason))
# Crea Dizionario Episodi
if episode == 0:
diff --git a/specials/downloads.py b/specials/downloads.py
index f4be3e22..ed2604b5 100644
--- a/specials/downloads.py
+++ b/specials/downloads.py
@@ -814,7 +814,7 @@ def save_download(item):
del item.from_action
del item.from_channel
- item.contentChannel = item.fromchannel if item.fromchannel else item.channel
+ item.contentChannel = item.from_channel if item.from_channel else item.channel
item.contentAction = item.fromaction if item.fromaction else item.action
if item.contentType in ["tvshow", "episode", "season"]: