Enable using saved playlists in My Subscriptions

This commit is contained in:
MoojMidge 2025-11-17 08:26:49 +11:00
parent 1408eb7515
commit d88816b012

View file

@ -2758,38 +2758,49 @@ class YouTubeDataClient(YouTubeLoginClient):
del _params['pageToken'] del _params['pageToken']
return True, True return True, True
# playlist_params = { playlist_params = {
# 'part': 'snippet', 'part': 'snippet',
# 'maxResults': 50, 'maxResults': 50,
# 'order': 'alphabetical', 'order': 'alphabetical',
# 'mine': True, 'mine': True,
# } }
#
# def _get_playlists(output, def _get_playlists(output,
# _params=playlist_params, _params=playlist_params,
# _refresh=refresh, _refresh=refresh,
# _force_cache=force_cache, _force_cache=force_cache,
# function_cache=function_cache): function_cache=function_cache):
# json_data = function_cache.run( own_channel = self.channel_id
# self.get_saved_playlists, if own_channel:
# function_cache.ONE_HOUR own_channel = (own_channel,)
# if _force_cache or 'pageToken' in _params else
# 5 * function_cache.ONE_MINUTE, json_data = function_cache.run(
# _refresh=_refresh, self.get_browse_items,
# **kwargs function_cache.ONE_HOUR
# ) if _force_cache or 'pageToken' in _params else
# if not json_data: 5 * function_cache.ONE_MINUTE,
# return False, True _refresh=_refresh,
# browse_id='FEplaylist_aggregation',
# output['playlist_ids'].extend([{ client='tv',
# 'playlist_id': item['snippet']['resourceId']['playlistId'] skip_ids=own_channel,
# } for item in json_data.get('items', [])]) response_type='playlists',
# do_auth=True,
# subs_page_token = json_data.get('nextPageToken') json_path=self.JSON_PATHS['tv_grid'],
# if subs_page_token: **kwargs
# _params['pageToken'] = subs_page_token )
# return True, False if not json_data:
# return True, True return False, True
output['playlist_ids'].extend([
item['id']
for item in json_data.get('items', [])
])
subs_page_token = json_data.get('nextPageToken')
if subs_page_token:
_params['pageToken'] = subs_page_token
return True, False
return True, True
payloads[1] = { payloads[1] = {
'worker': _get_channels, 'worker': _get_channels,
@ -2801,15 +2812,16 @@ class YouTubeDataClient(YouTubeLoginClient):
'check_inputs': False, 'check_inputs': False,
'inputs_to_check': None, 'inputs_to_check': None,
} }
# payloads[2] = { payloads[2] = {
# 'worker': _get_playlists, 'worker': _get_playlists,
# 'kwargs': True, 'kwargs': True,
# 'output': threaded_output, 'do_batch': False,
# 'threads': threads, 'output': threaded_output,
# 'limit': 1, 'threads': threads,
# 'check_inputs': False, 'limit': 1,
# 'inputs_to_check': None, 'check_inputs': False,
# } 'inputs_to_check': None,
}
payloads[3] = { payloads[3] = {
'worker': partial(_get_cached_feed, item_type='channel_id'), 'worker': partial(_get_cached_feed, item_type='channel_id'),
'kwargs': threaded_output['channel_ids'], 'kwargs': threaded_output['channel_ids'],
@ -2827,10 +2839,8 @@ class YouTubeDataClient(YouTubeLoginClient):
'output': threaded_output, 'output': threaded_output,
'threads': threads, 'threads': threads,
'limit': None, 'limit': None,
# 'check_inputs': threading.Event(), 'check_inputs': threading.Event(),
# 'inputs_to_check': {2}, 'inputs_to_check': {2},
'check_inputs': False,
'inputs_to_check': None,
} }
payloads[5] = { payloads[5] = {
'worker': _get_feed, 'worker': _get_feed,