Skip to content

Commit

Permalink
Add support for sequentially filling Trending listing
Browse files Browse the repository at this point in the history
  • Loading branch information
MoojMidge committed Dec 7, 2024
1 parent 8d75d28 commit b6f2324
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions resources/lib/youtube_plugin/youtube/helper/yt_specials.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,24 @@ def _process_trending(provider, context, client):
context.set_content(CONTENT.VIDEO_CONTENT)

json_data = client.get_trending_videos(
page_token=context.get_param('page_token', '')
page_token=context.get_param('page_token')
)

if not json_data:
return False
return v3.response_to_items(provider, context, json_data)
if json_data:
def filler(json_data, _remaining):
page_token = json_data.get('nextPageToken')
if not page_token:
return None

json_data = client.get_trending_videos(
page_token=page_token,
)
json_data['_filler'] = filler
return json_data

json_data['_filler'] = filler
return v3.response_to_items(provider, context, json_data)
return False


def _process_browse_channels(provider, context, client):
Expand Down

0 comments on commit b6f2324

Please sign in to comment.