From d7918418a2ac0e82f0d2f68ef5ed3bc9fa8a9831 Mon Sep 17 00:00:00 2001 From: Alhaziel01 Date: Thu, 8 Jul 2021 09:03:35 +0200 Subject: [PATCH] Fix AniPlay --- channels/aniplay.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/channels/aniplay.py b/channels/aniplay.py index 257cfaf8..9215f738 100644 --- a/channels/aniplay.py +++ b/channels/aniplay.py @@ -197,7 +197,11 @@ def episodios(item): url = '{}/api/anime/{}'.format(host, item.id) json = httptools.downloadpage(url, CF=False ).json - if json.get('seasons'): + if type(json) == list: + item.show_renumber = False + itemlist = list_episodes(item, json) + + elif json.get('seasons'): seasons = json['seasons'] seasons.sort(key=lambda s: s['episodeStart']) @@ -234,12 +238,13 @@ def episodios(item): # add add to videolibrary menu if stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']: support.videolibrary(itemlist, item) - + return itemlist - + def list_episodes(item, json=None): itemlist = [] + if not json: url = '{}/api/anime/{}'.format(host, item.id) json = httptools.downloadpage(url, CF=False ).json @@ -323,4 +328,4 @@ def get_lang(value): title = value.split('(')[0] if value else '' scrapedlang = scrapertools.find_single_match(value, r'\(([^\)]+)') lang = scrapedlang.upper() if scrapedlang else 'Sub-ITA' - return title, lang \ No newline at end of file + return title, lang