Fix e migliorie Paginazione

This commit is contained in:
Alhaziel01
2021-09-18 12:32:37 +02:00
parent 7196425322
commit 69a6a98a56
6 changed files with 156 additions and 110 deletions
+32 -15
View File
@@ -3,7 +3,7 @@
# Canale per AnimeForce # Canale per AnimeForce
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import support from core import scrapertools, support
from platformcode import logger from platformcode import logger
host = support.config.get_channel_url() host = support.config.get_channel_url()
@@ -106,22 +106,39 @@ def check(item):
else: else:
return episodios(item) return episodios(item)
@support.scrape
def episodios(item): def episodios(item):
numerationEnabled = True @support.scrape
data = item.data def _episodes(item):
actLike = 'episodios'
disableAll = True
data = item.data
if '<h6>Streaming</h6>' in data:
patron = r'<td style[^>]+>\s*.*?(?:<span[^>]+)?<strong>(?P<episode>[^<]+)<\/strong>.*?<td style[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>'
else:
patron = r'<a\s*href="(?P<url>[^"]+)"[^>]+>(?P<episode>\d+)[<-](?P<episode2>\d+)?'
def itemHook(item):
if item.url.startswith('//'): item.url= 'https:' + item.url
elif item.url.startswith('/'): item.url= 'https:/' + item.url
return item
action = 'findvideos'
return locals()
itemlist = support.itemlistdb() if item.itemlist else []
groups = support.match(item.data, patron=[r'"tabpanel">.*?</div', r'Special-tab">.*?</div']).matches
for group in groups:
item.data = group
if 'Special' in group:
item.contentSeason = 0
itemlist.extend(_episodes(item))
from platformcode.autorenumber import start
start(itemlist, item)
itemlist = support.season_pagination(itemlist, item, function_level='episodios')
return itemlist
if '<h6>Streaming</h6>' in data:
patron = r'<td style[^>]+>\s*.*?(?:<span[^>]+)?<strong>(?P<title>[^<]+)<\/strong>.*?<td style[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>'
else:
patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)"\s*class="btn btn-dark mb-1">'
def itemHook(item):
if item.url.startswith('//'): item.url= 'https:' + item.url
elif item.url.startswith('/'): item.url= 'https:/' + item.url
return item
action = 'findvideos'
return locals()
def findvideos(item): def findvideos(item):
+7 -6
View File
@@ -21,12 +21,13 @@ def get_cookie(data):
def get_data(item): def get_data(item):
# support.dbg() data = ''
url = httptools.downloadpage(item.url, headers=headers, follow_redirects=True, only_headers=True).url if item.url:
data = support.match(url, headers=headers, follow_redirects=True).data url = httptools.downloadpage(item.url, headers=headers, follow_redirects=True, only_headers=True).url
if 'AWCookieVerify' in data: data = support.match(url, headers=headers, follow_redirects=True).data
get_cookie(data) if 'AWCookieVerify' in data:
data = get_data(item) get_cookie(data)
data = get_data(item)
return data return data
+45 -47
View File
@@ -2,7 +2,7 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
# Canale per cineblog01 # Canale per cineblog01
# ------------------------------------------------------------ # ------------------------------------------------------------
import datetime
import re import re
from core import scrapertools, httptools, servertools, support from core import scrapertools, httptools, servertools, support
@@ -142,7 +142,7 @@ def episodios(item):
disableAll = True disableAll = True
patronBlock = r'(?P<block>sp-head[^>]+>\s*(?:STAGION[EI]\s*(?:(?:DA)?\s*[0-9]+\s*A)?\s*[0-9]+|MINISSERIE)(?::\s*PARTE\s*[0-9]+)? - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?<\/div>.*?)spdiv[^>]*>' patronBlock = r'(?P<block>sp-head[^>]+>\s*(?:STAGION[EI]\s*(?:(?:DA)?\s*[0-9]+\s*A)?\s*[0-9]+|MINISSERIE)(?::\s*PARTE\s*[0-9]+)? - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?<\/div>.*?)spdiv[^>]*>'
patron = r'(?:/>|<p>|<strong>)(?P<other>.*?(?P<episode>[0-9]+(?:&#215;|×)[0-9]+)\s*(?P<title2>.*?)?(?:\s*&#8211;|\s*-|\s*<).*?)(?:<\/p>|<br)' patron = r'(?:/>|<p>|<strong>)(?P<data>.*?(?P<episode>[0-9]+(?:&#215;|×)[0-9]+)\s*(?P<title2>.*?)?(?:\s*&#8211;|\s*-|\s*<).*?)(?:<\/p>|<br)'
return locals() return locals()
@@ -156,20 +156,21 @@ def episodios(item):
folderUrl = scrapertools.find_single_match(data, r'TUTT[EA] L[EA] \w+\s+(?:&#8211;|-)\s+<a href="?([^" ]+)') folderUrl = scrapertools.find_single_match(data, r'TUTT[EA] L[EA] \w+\s+(?:&#8211;|-)\s+<a href="?([^" ]+)')
data = httptools.downloadpage(folderUrl, disable_directIP=True).data data = httptools.downloadpage(folderUrl, disable_directIP=True).data
patron = r'<td>(?P<title>[^<]+)<td><a [^>]+href="(?P<url>[^"]+)[^>]+>' patron = r'<td>(?P<title>[^<]+)<td><a [^>]+href="(?P<folderdata>[^"]+)[^>]+>'
return locals() return locals()
data = support.match(item.url, headers=headers).data data = support.match(item.url, headers=headers).data
# itemlist = listed(item, data)
itemlist = [] itemlist = listed(item, data)
if not item.itemlist: itemlist.extend(folder(item, data) if 'TUTTE LE' in data or 'TUTTA LA' in data else [])
itemlist.extend(folder(item, data) if 'TUTTE LE' in data or 'TUTTA LA' in data else [])
itemDict = {'ITA':{}, 'Sub-ITA':{}} itemDict = {'ITA':{}, 'Sub-ITA':{}}
seasons = [] seasons = []
# support.dbg()
for it in itemlist: for it in itemlist:
it.contentType = 'episode'
if it.contentSeason and it.contentSeason not in seasons: if it.contentSeason and it.contentSeason not in seasons:
seasons.append(it.contentSeason) seasons.append(it.contentSeason)
itemDict['ITA'][it.contentSeason] = [] itemDict['ITA'][it.contentSeason] = []
@@ -185,13 +186,15 @@ def episodios(item):
itlist.extend(sorted(itemDict['Sub-ITA'].get(season, []), key=lambda it: (it.contentSeason, it.contentEpisodeNumber))) itlist.extend(sorted(itemDict['Sub-ITA'].get(season, []), key=lambda it: (it.contentSeason, it.contentEpisodeNumber)))
itemlist = itlist itemlist = itlist
for i in itemlist: logger.debug(i.title, i.contentType)
import inspect import inspect
if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']: if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']:
if len(seasons) > 1: if len(seasons) > 1:
itemlist = support.season_pagination(itemlist, item, [], 'episodios') itemlist = support.season_pagination(itemlist, item, [], 'episodios')
else: else:
itemlist = support.pagination(itemlist, item, 'episodios') itemlist = support.pagination(itemlist, item, 'episodios')
if config.get_setting('episode_info'):
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
support.videolibrary(itemlist, item) support.videolibrary(itemlist, item)
support.download(itemlist, item) support.download(itemlist, item)
@@ -199,56 +202,51 @@ def episodios(item):
def findvideos(item): def findvideos(item):
if item.serieFolder:
return support.server(item, data=item.url)
if item.contentType == "episode":
return findvid_serie(item)
def load_links(itemlist, re_txt, desc_txt, quality=""):
streaming = scrapertools.find_single_match(data, re_txt).replace('"', '')
logger.debug('STREAMING', streaming)
logger.debug('STREAMING=', streaming)
matches = support.match(streaming, patron = r'<td><a.*?href=([^ ]+) [^>]+>([^<]+)<').matches
for scrapedurl, scrapedtitle in matches:
logger.debug("##### findvideos %s ## %s ## %s ##" % (desc_txt, scrapedurl, scrapedtitle))
itemlist.append(item.clone(action="play", title=scrapedtitle, url=scrapedurl, server=scrapedtitle, quality=quality))
logger.debug() logger.debug()
if item.folderdata:
return support.server(item, data=item.folderdata)
elif item.data:
return support.server(item, data=re.sub(r'((?:<p>|<strong>)?[^\d]*\d*(?:&#215;|×)[0-9]+[^<]+)', '', item.data))
else:
itemlist = [] def load_links(itemlist, re_txt, desc_txt, quality=""):
streaming = scrapertools.find_single_match(data, re_txt).replace('"', '')
logger.debug('STREAMING', streaming)
logger.debug('STREAMING=', streaming)
matches = support.match(streaming, patron = r'<td><a.*?href=([^ ]+) [^>]+>([^<]+)<').matches
for scrapedurl, scrapedtitle in matches:
logger.debug("##### findvideos %s ## %s ## %s ##" % (desc_txt, scrapedurl, scrapedtitle))
itemlist.append(item.clone(action="play", title=scrapedtitle, url=scrapedurl, server=scrapedtitle, quality=quality))
# Carica la pagina logger.debug()
data = httptools.downloadpage(item.url).data
data = re.sub('\n|\t', '', data)
# Estrae i contenuti - Streaming itemlist = []
load_links(itemlist, '<strong>Streamin?g:</strong>(.*?)cbtable', "Streaming", "SD")
# Estrae i contenuti - Streaming HD # Carica la pagina
load_links(itemlist, '<strong>Streamin?g HD[^<]+</strong>(.*?)cbtable', "Streaming HD", "HD") data = httptools.downloadpage(item.url).data
data = re.sub('\n|\t', '', data)
# Estrae i contenuti - Streaming 3D # Estrae i contenuti - Streaming
load_links(itemlist, '<strong>Streamin?g 3D[^<]+</strong>(.*?)cbtable', "Streaming 3D") load_links(itemlist, '<strong>Streamin?g:</strong>(.*?)cbtable', "Streaming", "SD")
itemlist = support.server(item, itemlist=itemlist) # Estrae i contenuti - Streaming HD
# Extract the quality format load_links(itemlist, '<strong>Streamin?g HD[^<]+</strong>(.*?)cbtable', "Streaming HD", "HD")
patronvideos = r'([\w.]+)</strong></div></td>'
support.addQualityTag(item, itemlist, data, patronvideos)
return itemlist # Estrae i contenuti - Streaming 3D
load_links(itemlist, '<strong>Streamin?g 3D[^<]+</strong>(.*?)cbtable', "Streaming 3D")
# Estrae i contenuti - Download itemlist = support.server(item, itemlist=itemlist)
# load_links(itemlist, '<strong>Download:</strong>(.*?)<tableclass=cbtable height=30>', "aqua", "Download") # Extract the quality format
patronvideos = r'([\w.]+)</strong></div></td>'
support.addQualityTag(item, itemlist, data, patronvideos)
# Estrae i contenuti - Download HD return itemlist
# load_links(itemlist, '<strong>Download HD[^<]+</strong>(.*?)<tableclass=cbtable width=100% height=20>', "azure", "Download HD")
# Estrae i contenuti - Download
# load_links(itemlist, '<strong>Download:</strong>(.*?)<tableclass=cbtable height=30>', "aqua", "Download")
def findvid_serie(item): # Estrae i contenuti - Download HD
logger.debug() # load_links(itemlist, '<strong>Download HD[^<]+</strong>(.*?)<tableclass=cbtable width=100% height=20>', "azure", "Download HD")
data = re.sub(r'((?:<p>|<strong>)?[^\d]*\d*(?:&#215;|×)[0-9]+[^<]+)', '', item.other)
return support.server(item, data=data)
def play(item): def play(item):
+62 -29
View File
@@ -138,6 +138,7 @@ class scrape:
self.downloadEnabled = self.args.get('downloadEnabled', True) self.downloadEnabled = self.args.get('downloadEnabled', True)
if self.args.get('disableAll', False): if self.args.get('disableAll', False):
self.tmdbEnabled = False
self.videlibraryEnabled = False self.videlibraryEnabled = False
self.downloadEnabled = False self.downloadEnabled = False
self.seasonPagination = False self.seasonPagination = False
@@ -235,7 +236,7 @@ class scrape:
autorenumber.start(self.itemlist, item) autorenumber.start(self.itemlist, item)
for i in self.itemlist: for i in self.itemlist:
if i.contentSeason and i.contentSeason not in self.seasons: if type(i.contentSeason) == int and i.contentSeason not in self.seasons:
self.seasons.append(i.contentSeason) self.seasons.append(i.contentSeason)
else: autorenumber.start(self.itemlist) else: autorenumber.start(self.itemlist)
@@ -244,10 +245,14 @@ class scrape:
if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']: if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']:
if len(self.seasons) > 1 and self.seasonPagination: if len(self.seasons) > 1 and self.seasonPagination:
self.itemlist = season_pagination(self.itemlist, item, self.seasons, self.function) self.itemlist = season_pagination(self.itemlist, item, self.seasons, self.function)
elif self.pagination: elif self.pagination or (self.function in ['episodios'] and self.seasonPagination):
self.itemlist = pagination(self.itemlist, item, self.function) self.itemlist = pagination(self.itemlist, item, self.function)
if self.action != 'play' and 'patronMenu' not in self.args and 'patronGenreMenu' not in self.args and self.tmdbEnabled and inspect.stack()[1][3] not in ['add_tvshow'] and self.function not in ['episodios', 'mainlist'] or (self.function in ['episodios'] and config.get_setting('episode_info')): # and function != 'episodios' and item.contentType in ['movie', 'tvshow', 'episode', 'undefined'] if self.tmdbEnabled and (
self.action != 'play' and 'patronMenu' not in self.args and 'patronGenreMenu' not in self.args
and inspect.stack()[1][3] not in ['add_tvshow'] and (self.function not in ['episodios', 'mainlist']
or (self.function in ['episodios'] and config.get_setting('episode_info')))):
tmdb.set_infoLabels_itemlist(self.itemlist, seekTmdb=True) tmdb.set_infoLabels_itemlist(self.itemlist, seekTmdb=True)
if inspect.stack()[1][3] not in ['find_episodes', 'add_tvshow']: if inspect.stack()[1][3] not in ['find_episodes', 'add_tvshow']:
@@ -332,7 +337,7 @@ class scrape:
self.matches.extend(matches) self.matches.extend(matches)
def set_infolabels(self, item): def set_infolabels(self, item):
if item.infoLabels["title"] == self.itemParams.title: if item.infoLabels["title"]:
infolabels = item.infoLabels infolabels = item.infoLabels
else: else:
if self.function == 'episodios': if self.function == 'episodios':
@@ -360,6 +365,7 @@ class scrape:
infolabels['rating'] = scrapertools.decodeHtmlentities(self.itemParams.rating) infolabels['rating'] = scrapertools.decodeHtmlentities(self.itemParams.rating)
self.itemParams.infoLabels = infolabels self.itemParams.infoLabels = infolabels
logger.debug
def set_sceneTitle(self): def set_sceneTitle(self):
from lib.guessit import guessit from lib.guessit import guessit
@@ -447,20 +453,18 @@ class scrape:
break break
else: AC = self.action else: AC = self.action
if (not self.itemParams.title or self.itemParams.title not in self.blacklist) and (self.search.lower() in self.itemParams.title.lower()): if (not self.itemParams.title or self.itemParams.title not in self.blacklist) and (self.search.lower() in self.itemParams.title.lower()):
it = item.clone(title=self.itemParams.title, it = item.clone(title=self.itemParams.title,
fulltitle=self.itemParams.title, fulltitle=self.itemParams.title,
show=self.itemParams.title, show=self.itemParams.title,
infoLabels=self.itemParams.infoLabels, infoLabels=self.itemParams.infoLabels,
contentSeason= self.itemParams.infoLabels.get('season', ''),
contentEpisodeNumber= self.itemParams.infoLabels.get('episode', ''),
grouped = self.group, grouped = self.group,
episode2 = self.itemParams.second_episode, episode2 = self.itemParams.second_episode,
extraInfo = self.itemParams.extraInfo, extraInfo = self.itemParams.extraInfo,
disable_videolibrary = not self.args.get('addVideolibrary', True), disable_videolibrary = not self.args.get('addVideolibrary', True),
size = self.itemParams.size, size = self.itemParams.size,
seed = self.itemParams.seed) seed = self.itemParams.seed)
if self.itemParams.infoLabels.get('season'): it.contentSeason = self.itemParams.infoLabels.get('season')
if self.itemParams.infoLabels.get('episode'): it.contentEpisodeNumber = self.itemParams.infoLabels.get('episode')
if self.itemParams.url: it.url = self.itemParams.url if self.itemParams.url: it.url = self.itemParams.url
if self.function == 'episodios': it.fulltitle = it.show = self.itemParams.title if self.function == 'episodios': it.fulltitle = it.show = self.itemParams.title
if self.itemParams.quality: it.quality = self.itemParams.quality if self.itemParams.quality: it.quality = self.itemParams.quality
@@ -470,8 +474,6 @@ class scrape:
it.contentType = 'episode' if self.function == 'episodios' else CT if CT else item.contentType it.contentType = 'episode' if self.function == 'episodios' else CT if CT else item.contentType
if it.contentType not in ['movie'] and self.function != 'episodios' or it.contentType in ['undefined']: it.contentSerieName = self.itemParams.title if it.contentType not in ['movie'] and self.function != 'episodios' or it.contentType in ['undefined']: it.contentSerieName = self.itemParams.title
if self.function == 'peliculas': it.contentTitle= self.itemParams.title if self.function == 'peliculas': it.contentTitle= self.itemParams.title
it.contentSeason= self.itemParams.infoLabels.get('season', ''),
it.contentEpisodeNumber= self.itemParams.infoLabels.get('episode', ''),
if self.itemParams.title2: it.title2 = self.itemParams.title2 if self.itemParams.title2: it.title2 = self.itemParams.title2
if self.itemParams.episode and self.group and not item.grouped: if self.itemParams.episode and self.group and not item.grouped:
@@ -494,7 +496,7 @@ class scrape:
except: except:
raise logger.ChannelScraperException raise logger.ChannelScraperException
if it.contentSeason and it.contentSeason not in self.seasons: if type(it.contentSeason) == int and it.contentSeason not in self.seasons:
self.seasons.append(it.contentSeason) self.seasons.append(it.contentSeason)
return it return it
@@ -903,7 +905,8 @@ def nextPage(itemlist, item, function_or_level=1, **kwargs):
total_pages = total_pages, total_pages = total_pages,
page=page if page else item.page + 1 if item.page else 2, page=page if page else item.page + 1 if item.page else 2,
prevthumb = item.thumbnail, prevthumb = item.thumbnail,
thumbnail=thumb())) thumbnail=thumb(),
folder = False))
return itemlist return itemlist
@@ -923,20 +926,44 @@ def pagination(itemlist, item, function_level=1):
if len(itemlist) >= item.page * perpage: if len(itemlist) >= item.page * perpage:
itemlistdb(itemlist) itemlistdb(itemlist)
itlist.append( itlist.append(
item.clone(channel=item.channel, Item(channel=item.channel,
action=action, contentType=item.contentType,
contentType=item.contentType, action=action,
title=typo(config.get_localized_string(30992), 'color kod bold'), title=typo(config.get_localized_string(90006), 'color kod bold'),
page=item.page + 1, page=item.page + 1,
total_pages=round(len(itemlist)/perpage), total_pages=round(len(itemlist)/perpage),
nextPage = True, nextPage = True,
itemlist = True, itemlist = True,
prevthumb = item.thumbnail, prevthumb = item.thumbnail,
thumbnail=thumb())) thumbnail=thumb()))
itlist.append(
Item(channel=item.channel,
contentType=item.contentType,
action='gotopage',
real_action=action,
title=typo(config.get_localized_string(90007), 'color kod bold'),
page=item.page + 1,
total_pages=round(len(itemlist)/perpage),
nextPage = True,
itemlist = True,
prevthumb = item.thumbnail,
thumbnail=thumb(),
folder = False))
# itlist.append(
# item.clone(channel=item.channel,
# action=action,
# contentType=item.contentType,
# title=typo(config.get_localized_string(90006), 'color kod bold'),
# page=item.page + 1,
# total_pages=round(len(itemlist)/perpage),
# nextPage = True,
# itemlist = True,
# prevthumb = item.thumbnail,
# thumbnail=thumb()))
return itlist return itlist
def season_pagination(itemlist, item, seasons, function_level=1): def season_pagination(itemlist, item, seasons=[], function_level=1):
if 'channel_search' in [s[3] for s in inspect.stack()]: if 'channel_search' in [s[3] for s in inspect.stack()]:
return itemlist return itemlist
@@ -945,21 +972,23 @@ def season_pagination(itemlist, item, seasons, function_level=1):
if itemlist and not seasons: if itemlist and not seasons:
seasons = [] seasons = []
for it in itemlist: for it in itemlist:
if it.contentSeason and it.contentSeason not in seasons: if type(it.contentSeason) == int and it.contentSeason not in seasons:
seasons.append(it.contentSeason) seasons.append(it.contentSeason)
if seasons: if len(seasons) > 1:
itemlistdb(itemlist) itemlistdb(itemlist)
seasons.sort() seasons.sort()
if not item.nextSeason: if not item.nextSeason:
item.nextSeason = 0 item.nextSeason = 0
try: try:
current = seasons[item.nextSeason] current = seasons[item.nextSeason]
for it in itemlist: for it in sorted(itemlist, key=lambda it: (it.contentSeason, it.contentEpisodeNumber)):
if it.contentSeason and it.contentSeason == current: logger.debug('SEASON',it.contentSeason)
if type(it.contentSeason) == int and it.contentSeason == current:
itlist.append(it) itlist.append(it)
elif it.contentSeason and it.contentSeason > current: elif type(it.contentSeason) == int and it.contentSeason > current:
break break
if item.nextSeason + 1 < len(seasons): if item.nextSeason + 1 < len(seasons):
@@ -981,10 +1010,14 @@ def season_pagination(itemlist, item, seasons, function_level=1):
nextSeason = item.nextSeason + 1, nextSeason = item.nextSeason + 1,
itemlist = True, itemlist = True,
prevthumb = item.thumbnail, prevthumb = item.thumbnail,
thumbnail=thumb())) thumbnail=thumb(),
folder = False))
return itlist return itlist
except: except:
return itemlist return itemlist
else:
return pagination(itemlist, item, function_level)
# Find servers # Find servers
+6 -7
View File
@@ -4,11 +4,10 @@
# -------------------------------------------------------------------------------- # --------------------------------------------------------------------------------
from core import support import xbmc, xbmcgui, re, base64, sys
import xbmc, xbmcgui, re, base64, inspect, sys from core import jsontools, tmdb, filetools
from core import jsontools, tmdb, scrapertools, filetools
from core.item import Item from core.item import Item
from core.support import typo, match, dbg, Item from core.support import typo, dbg, Item
from platformcode import config, platformtools, logger from platformcode import config, platformtools, logger
PY3 = True if sys.version_info[0] >= 3 else False PY3 = True if sys.version_info[0] >= 3 else False
if PY3: if PY3:
@@ -72,7 +71,7 @@ def b64(json, mode = 'encode'):
def find_episodes(item): def find_episodes(item):
logger.debug() logger.debug()
ch = __import__('channels.' + item.channel, fromlist=["channels.{}".format(item.channel)]) ch = __import__('channels.' + item.channel, fromlist=["channels.{}".format(item.channel)])
itemlist = ch.episodios(item) itemlist = getattr(ch, item.action)(item)
return itemlist return itemlist
def busy(state): def busy(state):
@@ -180,7 +179,7 @@ class autorenumber():
def renumber(self): def renumber(self):
def sub_thread(item): def sub_thread(item):
if not item.contentSeason: if type(item.contentSeason) != int:
number = str(item.contentEpisodeNumber) number = str(item.contentEpisodeNumber)
if number: if number:
if not number in self.episodes: self.makelist() if not number in self.episodes: self.makelist()
@@ -188,7 +187,7 @@ class autorenumber():
item.contentSeason = int(self.episodes[number].split('x')[0]) item.contentSeason = int(self.episodes[number].split('x')[0])
item.contentEpisodeNumber = int(self.episodes[number].split('x')[1]) item.contentEpisodeNumber = int(self.episodes[number].split('x')[1])
# support.dbg() # dbg()
# for i in self.itemlist: # for i in self.itemlist:
# sub_thread(i) # sub_thread(i)
+4 -6
View File
@@ -167,8 +167,8 @@ def run(item=None):
item.page = page item.page = page
import re import re
item.url = re.sub('([=/])[0-9]+(/?)$', '\g<1>{}\g<2>'.format(page), item.url) item.url = re.sub('([=/])[0-9]+(/?)$', '\g<1>{}\g<2>'.format(page), item.url)
run(item) xbmc.executebuiltin("Container.Update(%s?%s)" % (sys.argv[0], item.tourl()))
# xbmc.executebuiltin("Container.Update(%s?%s)" % (sys.argv[0], item.tourl()))
elif item.action == "gotoseason": elif item.action == "gotoseason":
head = 'Seleziona la stagione' head = 'Seleziona la stagione'
seasons = [str(s) for s in item.allSeasons] seasons = [str(s) for s in item.allSeasons]
@@ -176,10 +176,8 @@ def run(item=None):
if int(season) > -1: if int(season) > -1:
import xbmc import xbmc
item.action = item.real_action item.action = item.real_action
item.nextSeason = item.allSeasons.index(season + 1) item.nextSeason = season
run(item) xbmc.executebuiltin("Container.Update(%s?%s)" % (sys.argv[0], item.tourl()))
# logger.debug(item)
# xbmc.executebuiltin("Container.Update(%s?%s)" % (sys.argv[0], new_item.tourl()))
else: else:
# Checks if channel exists # Checks if channel exists
if os.path.isfile(os.path.join(config.get_runtime_path(), 'channels', item.channel + ".py")): if os.path.isfile(os.path.join(config.get_runtime_path(), 'channels', item.channel + ".py")):