Fix Download Anime

This commit is contained in:
Alhaziel
2019-10-05 09:27:19 +02:00
parent 49d75fce7b
commit bbdb0df3fe
3 changed files with 25 additions and 19 deletions

View File

@@ -275,7 +275,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
infoLabels=infolabels,
thumbnail=item.thumbnail if function == 'episodios' else scraped["thumb"] ,
args=item.args,
contentSerieName= title if item.contentType or CT != 'movie' and function != 'episodios' else item.fulltitle if function == 'episodios' else '',
contentSerieName= item.title if item.contentType or CT != 'movie' and function != 'episodios' else item.fulltitle if function == 'episodios' else '',
contentTitle= title if item.contentType or CT == 'movie' else '',
contentLanguage = lang1,
contentEpisodeNumber=episode if episode else ''
@@ -756,13 +756,13 @@ def download(itemlist, item, typography='', function_level=1, function=''):
if not typography: typography = 'color kod bold'
if item.contentType == 'movie':
fromaction = 'findvideos'
from_action = 'findvideos'
title = typo(config.get_localized_string(60354), typography)
elif item.contentType == 'episode':
fromaction = 'findvideos'
from_action = 'findvideos'
title = typo(config.get_localized_string(60356), typography) + ' - ' + item.title
else:
fromaction = 'episodios'
from_action = 'episodios'
title = typo(config.get_localized_string(60355), typography)
function = function if function else inspect.stack()[function_level][3]
@@ -781,10 +781,10 @@ def download(itemlist, item, typography='', function_level=1, function=''):
contentSerieName=contentSerieName,
url=item.url,
action='save_download',
fromaction=fromaction,
from_action=from_action,
contentTitle=contentTitle
))
if fromaction == 'episodios':
if from_action == 'episodios':
itemlist.append(
Item(channel='downloads',
from_channel=item.channel,
@@ -795,7 +795,7 @@ def download(itemlist, item, typography='', function_level=1, function=''):
contentSerieName=contentSerieName,
url=item.url,
action='save_download',
fromaction=fromaction,
from_action=from_action,
contentTitle=contentTitle,
download='season'
))

View File

@@ -114,7 +114,7 @@ def manual_renumeration(item, modify=False):
dict_series[title] = dict_renumerate
# channel = __import__('channels.' + item.channel, fromlist=["channels.%s" % item.channel])
itemlist = get_episodes(item)
itemlist = find_episodes(item)
for item in itemlist:
Title = re.sub(r'\d+x\d+ - ', '', item.title)
if modify == True:
@@ -210,7 +210,7 @@ def semiautomatic_config_item(item):
jsontools.update_node(dict_series, item.channel, TAG_TVSHOW_RENUMERATE)[0]
_list = []
# channel = __import__('channels.' + item.channel, fromlist=["channels.%s" % item.channel])
itemlist = get_episodes(item)
itemlist = find_episodes(item)
for item in itemlist:
Title = re.sub(r'\d+x\d+ - ', '', item.title)
if item.action == 'findvideos':
@@ -287,6 +287,7 @@ def config_item(item, itemlist=[], typography='', active=False):
def renumber(itemlist, item='', typography=''):
log()
# dbg()
# Carica Impostazioni
if itemlist:
settings_node = jsontools.get_node_from_file(itemlist[0].channel, 'settings')
@@ -294,23 +295,28 @@ def renumber(itemlist, item='', typography=''):
settings_node = {}
try: dict_series = jsontools.get_node_from_file(itemlist[0].channel, TAG_TVSHOW_RENUMERATE)
except: dict_series = {}
log('CHANNEL', itemlist[0])
# Seleziona la funzione Adatta, Menu Contestuale o Rinumerazione
if item:
if 'from_channel' in item:
item.channel = item.from_channel if item.from_channel else item.channel
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 inspect.stack()[2][3] == 'get_episodes':
log('dict', dict_series)
log('TITLE ', TITLE)
log('TITLE EXIST? ', TITLE in dict_series)
log('HAS ID? ',dict_series[TITLE].has_key(TAG_ID))
if inspect.stack()[2][3] == 'find_episodes':
log('PRENDO ITEMLIST ',inspect.stack()[2][3])
return itemlist
elif dict_series.has_key(TITLE) and dict_series[TITLE].has_key(TAG_ID):
ID = dict_series[TITLE][TAG_ID]
EPISODE = dict_series[TITLE][TAG_EPISODE]
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
@@ -349,7 +355,7 @@ def renumber(itemlist, item='', typography=''):
item.context = context(exist)
def renumeration (itemlist, item, typography, dict_series, ID, SEASON, EPISODE, MODE, TITLE, TYPE):
# Se ID è 0 salta la rinumerazione
if ID == '0':
return itemlist
@@ -543,7 +549,7 @@ def check(item):
exist = False
return exist
def get_episodes(item):
def find_episodes(item):
log()
ch = __import__('channels.' + item.channel, fromlist=["channels.%s" % item.channel])
itemlist = ch.episodios(item)

View File

@@ -811,11 +811,11 @@ def save_download(item):
if item.from_action and item.from_channel:
item.channel = item.from_channel
item.action = item.from_action
del item.from_action
del item.from_channel
item.from_action
item.from_channel
item.contentChannel = item.from_channel if item.from_channel else item.channel
item.contentAction = item.fromaction if item.fromaction else item.action
item.contentAction = item.from_action if item.from_action else item.action
if item.contentType in ["tvshow", "episode", "season"]:
if 'download' in item: