diff --git a/resources/lib/youtube_plugin/kodion/context/abstract_context.py b/resources/lib/youtube_plugin/kodion/context/abstract_context.py index 581f06a98..3473e2468 100644 --- a/resources/lib/youtube_plugin/kodion/context/abstract_context.py +++ b/resources/lib/youtube_plugin/kodion/context/abstract_context.py @@ -82,6 +82,7 @@ class AbstractContext(object): } _LIST_PARAMS = { 'channel_ids', + 'item_filter', 'playlist_ids', } _STRING_PARAMS = { diff --git a/resources/lib/youtube_plugin/kodion/settings/abstract_settings.py b/resources/lib/youtube_plugin/kodion/settings/abstract_settings.py index 928f09e0e..56c94b8fb 100644 --- a/resources/lib/youtube_plugin/kodion/settings/abstract_settings.py +++ b/resources/lib/youtube_plugin/kodion/settings/abstract_settings.py @@ -412,8 +412,13 @@ def stream_select(self, value=None): 'vod': True, } - def item_filter(self, update=None): - types = dict.fromkeys(self.get_string_list(SETTINGS.HIDE_VIDEOS), False) + def item_filter(self, update=None, override=None): + types = dict.fromkeys( + self.get_string_list(SETTINGS.HIDE_VIDEOS) + if override is None else + override, + False + ) types = dict(self._DEFAULT_FILTER, **types) if update: if 'live_folder' in update: diff --git a/resources/lib/youtube_plugin/youtube/helper/v3.py b/resources/lib/youtube_plugin/youtube/helper/v3.py index 9313de34f..d80a1365d 100644 --- a/resources/lib/youtube_plugin/youtube/helper/v3.py +++ b/resources/lib/youtube_plugin/youtube/helper/v3.py @@ -451,8 +451,13 @@ def response_to_items(provider, context.log_debug('v3 response discarded: |%s|' % kind) return [] + params = context.get_params() + if kind_type in _KNOWN_RESPONSE_KINDS: - item_filter = context.get_settings().item_filter(item_filter) + item_filter = context.get_settings().item_filter( + update=item_filter, + override=params.get('item_filter'), + ) result = _process_list_response( provider, context, json_data, item_filter ) @@ -477,7 +482,6 @@ def response_to_items(provider, We implemented our own calculation for the token into the YouTube client This should work for up to ~2000 entries. """ - params = context.get_params() current_page = params.get('page') next_page = current_page + 1 if current_page else 2 new_params = dict(params, page=next_page)