From c3ba3a1be641534aab37bbae9732a95f2a29863d Mon Sep 17 00:00:00 2001 From: marco <10120390+mac12m99@users.noreply.github.com> Date: Wed, 21 Sep 2022 20:27:44 +0200 Subject: [PATCH] Prova inspect.stack senza contesto --- channels/1337x.py | 2 +- channels/animeunity.py | 2 +- channels/paramount.py | 2 +- channels/toonitalia.py | 2 +- channels/vvvvid.py | 4 ++-- core/support.py | 10 +++++----- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/channels/1337x.py b/channels/1337x.py index 019b39bc..328ea150 100644 --- a/channels/1337x.py +++ b/channels/1337x.py @@ -115,7 +115,7 @@ def peliculas(item): action = 'seasons' patron = r']+>){4}\s*]+>(?P[^<]+)' - 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 diff --git a/channels/animeunity.py b/channels/animeunity.py index 01b17b52..ffefe0f4 100644 --- a/channels/animeunity.py +++ b/channels/animeunity.py @@ -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) diff --git a/channels/paramount.py b/channels/paramount.py index a4259d61..39cefd80 100644 --- a/channels/paramount.py +++ b/channels/paramount.py @@ -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) diff --git a/channels/toonitalia.py b/channels/toonitalia.py index a38a6ec5..67bd9fec 100644 --- a/channels/toonitalia.py +++ b/channels/toonitalia.py @@ -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 diff --git a/channels/vvvvid.py b/channels/vvvvid.py index 050de4de..5803870a 100644 --- a/channels/vvvvid.py +++ b/channels/vvvvid.py @@ -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) diff --git a/core/support.py b/core/support.py index 7c058f13..0ab9b60a 100755 --- a/core/support.py +++ b/core/support.py @@ -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,