Prova inspect.stack senza contesto
This commit is contained in:
@@ -115,7 +115,7 @@ def peliculas(item):
|
||||
action = 'seasons'
|
||||
patron = r'<img src="(?P<thumb>[^"]+)(?:[^>]+>){4}\s*<a href="(?P<url>[^"]+)[^>]+>(?P<title>[^<]+)'
|
||||
|
||||
if (item.args == 'search' or item.contentType != 'movie') and inspect.stack()[4][3] not in ['get_channel_results']:
|
||||
if (item.args == 'search' or item.contentType != 'movie') and inspect.stack(0)[4][3] not in ['get_channel_results']:
|
||||
patronNext = None
|
||||
def itemlistHook(itemlist):
|
||||
lastUrl = support.match(data, patron=r'href="([^"]+)">Last').match
|
||||
|
||||
@@ -210,7 +210,7 @@ def episodios(item):
|
||||
scws_id=it.get('scws_id', ''),
|
||||
video_url=it.get('link', '')))
|
||||
|
||||
if inspect.stack()[1][3] not in ['find_episodes']:
|
||||
if inspect.stack(0)[1][3] not in ['find_episodes']:
|
||||
autorenumber.start(itemlist, item)
|
||||
support.videolibrary(itemlist, item)
|
||||
support.download(itemlist, item)
|
||||
|
||||
@@ -155,7 +155,7 @@ def episodios(item):
|
||||
action='findvideos'))
|
||||
|
||||
itemlist.sort(key=lambda item: (item.season, item.episode))
|
||||
if inspect.stack()[1][3] not in ['find_episodes']:
|
||||
if inspect.stack(0)[1][3] not in ['find_episodes']:
|
||||
autorenumber.start(itemlist, item)
|
||||
return support.videolibrary(itemlist, item)
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ def episodios(item):
|
||||
itemlist = findepisode(item)
|
||||
if not itemlist: itemlist = [item.clone(action='findvideos')]
|
||||
|
||||
if inspect.stack()[1][3] not in ['find_episodes']:
|
||||
if inspect.stack(0)[1][3] not in ['find_episodes']:
|
||||
from platformcode import autorenumber
|
||||
autorenumber.start(itemlist, item)
|
||||
return itemlist
|
||||
|
||||
@@ -142,7 +142,7 @@ def peliculas(item):
|
||||
itlist.append(it)
|
||||
|
||||
if pagination and len(itemlist) >= pagination:
|
||||
if inspect.stack()[1][3] != 'get_newest':
|
||||
if inspect.stack(0)[1][3] != 'get_newest':
|
||||
itlist.append(
|
||||
item.clone(action='peliculas',
|
||||
title=support.typo(config.get_localized_string(30992), 'color kod bold'),
|
||||
@@ -192,7 +192,7 @@ def episodios(item):
|
||||
action= 'findvideos',
|
||||
video_id= episode['video_id']))
|
||||
|
||||
if inspect.stack()[1][3] not in ['find_episodes']:
|
||||
if inspect.stack(0)[1][3] not in ['find_episodes']:
|
||||
autorenumber.start(itemlist, item)
|
||||
|
||||
support.videolibrary(itemlist,item)
|
||||
|
||||
@@ -626,7 +626,7 @@ def scrape(func):
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
|
||||
if not group and not args.get('groupExplode') and ((pagination and len(matches) <= pag * pagination) or not pagination): # next page with pagination
|
||||
if patronNext and inspect.currentframe().f_back.f_code.co_name not in ['newest'] and len(inspect.stack()) > 2 and inspect.stack()[2][3] not in ['get_channel_results']:
|
||||
if patronNext and inspect.currentframe().f_back.f_code.co_name not in ['newest'] and len(inspect.stack(0)) > 2 and inspect.stack(0)[2][3] not in ['get_channel_results']:
|
||||
nextPage(itemlist, item, data, patronNext, function)
|
||||
|
||||
# for it in itemlist:
|
||||
@@ -1174,12 +1174,12 @@ def videolibrary(itemlist, item, typography='', function_level=1, function=''):
|
||||
extra = 'episodios'
|
||||
contentType = 'tvshow'
|
||||
|
||||
function = function if function else inspect.stack()[function_level][3]
|
||||
function = function if function else inspect.stack(0)[function_level][3]
|
||||
# go up until find findvideos/episodios
|
||||
while function not in ['findvideos', 'episodios']:
|
||||
function_level += 1
|
||||
try:
|
||||
function = inspect.stack()[function_level][3]
|
||||
function = inspect.stack(0)[function_level][3]
|
||||
except:
|
||||
break
|
||||
|
||||
@@ -1215,7 +1215,7 @@ def nextPage(itemlist, item, data='', patron='', function_or_level=1, next_page=
|
||||
# Function_level is useful if the function is called by another function.
|
||||
# If the call is direct, leave it blank
|
||||
logger.debug()
|
||||
action = inspect.stack()[function_or_level][3] if type(function_or_level) == int else function_or_level
|
||||
action = inspect.stack(0)[function_or_level][3] if type(function_or_level) == int else function_or_level
|
||||
|
||||
if not data and not patron and not next_page:
|
||||
itemlist.append(
|
||||
@@ -1250,7 +1250,7 @@ def pagination(itemlist, item, page, perpage, function_level=1):
|
||||
if len(itemlist) >= page * perpage:
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action=inspect.stack()[function_level][3],
|
||||
action=inspect.stack(0)[function_level][3],
|
||||
contentType=item.contentType,
|
||||
title=typo(config.get_localized_string(30992), 'color kod bold'),
|
||||
url=item.url,
|
||||
|
||||
Reference in New Issue
Block a user