Gives the global player a tracklist for a YouTube playlist, which the embed plays but doesn't list. It resolves the playlist to its entries' titles and lengths, for GET /api/remote/youtube.

They are read from the ytInitialData JSON of the public playlist page, whose undocumented shape changes, so both the current lockupViewModel rows and the older playlistVideoRenderer ones are accepted. Only the first 100 entries are there; the client adds the rest, untitled, as the player reports them.

Functions

f
parsePlaylistPage(
html: string,
listId: string
): YouTubePlaylist | null

Returns the playlist listId as read from its page html; null when the page has no ytInitialData or no track in it.

f
resolveYouTubePlaylist(listId: string): Promise<YouTubePlaylist>

Returns the tracklist of the playlist listId, from the cache when it was resolved in the last 6 hours.