diff --git a/resources/lib/addon.py b/resources/lib/addon.py index bc39b29..91352b6 100644 --- a/resources/lib/addon.py +++ b/resources/lib/addon.py @@ -559,7 +559,10 @@ def route(self, query): seasons = PARAMS.get('seasons', 'False') == 'True' if PARAMS['listVideos'].startswith('ID_'): items = self.api.get_list(PARAMS['listVideos'], PARAMS['list_param']) - self.listEpisodes(self.api.unfold_list(items, filter_kids=bool_setting('disable.kids'))) + filter_kids = bool_setting('disable.kids') + if 'Ultra' in items['title']: + filter_kids = False + self.listEpisodes(self.api.unfold_list(items, filter_kids=filter_kids)) else: self.list_entries(PARAMS['listVideos'], seasons) diff --git a/resources/lib/tvapi.py b/resources/lib/tvapi.py index afb032c..eac25ce 100644 --- a/resources/lib/tvapi.py +++ b/resources/lib/tvapi.py @@ -292,11 +292,16 @@ def get_list(self, id, param, use_cache=True): data = {'page_size': '24'} if param != 'NoParam': data['param'] = param - return self._request_get(url, params=data, use_cache=use_cache) + ret = self._request_get(url, params=data, use_cache=use_cache) + if len(ret['items']) == 0: + ret = self.get_recommendations(id, use_cache=use_cache, param=param) + return ret - def get_recommendations(self, id, use_cache=True): + def get_recommendations(self, id, use_cache=True, param=[]): url = URL + f'/recommendations/{id}' data = {'page_size': '24'} + if param: + data['param'] = param headers = {"X-Authorization": f'Bearer {self.profile_token()}'} return self._request_get(url, params=data, headers=headers, use_cache=use_cache) @@ -357,7 +362,7 @@ def kids_item(self, item): if item['classification']['code'] in ['DR-Ramasjang', 'DR-Minisjang']: return True if 'categories' in item: - for cat in ['dr minisjang', 'dr ramasjang', 'dr ultra']: + for cat in ['dr minisjang', 'dr ramasjang']: if cat in item['categories']: return True return False