Inner providesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/faraasaaay/inner/llms.txt
Use this file to discover all available pages before exploring further.
YouTube.player(), YouTube.next(), YouTube.queue(), YouTube.lyrics(), YouTube.related(), and YouTube.transcript() for all playback-related operations. All methods are suspend functions returning Result<T>.
Resolving a stream
YouTube.player(videoId, playlistId, client, signatureTimestamp, poToken, setLogin, authState) calls the InnerTube player endpoint and returns Result<PlayerResponse>. The PlayerResponse contains streaming data (streamingData), video details (videoDetails), and playback tracking URLs (playbackTracking).
| Parameter | Type | Description |
|---|---|---|
videoId | String | The YouTube video ID to resolve |
playlistId | String? | Optional playlist context for the player |
client | YouTubeClient | The client variant to use (affects available formats) |
signatureTimestamp | Int? | Signature timestamp for cipher decryption (optional) |
poToken | String? | Explicit proof-of-origin token (optional; falls back to authState) |
setLogin | Boolean | Whether to include the session cookie (default true) |
authState | PlaybackAuthState | Auth context; defaults to currentPlaybackAuthState() |
Queue management
YouTube.next(endpoint, continuation, followAutomixPreview) fetches the play queue for a given WatchEndpoint and returns Result<NextResult>. The NextResult data class contains:
title: String?— the queue title (e.g. playlist or radio name)items: List<SongItem>— tracks in the queuecurrentIndex: Int?— index of the currently selected tracklyricsEndpoint: BrowseEndpoint?— endpoint for fetching lyrics (pass toYouTube.lyrics())relatedEndpoint: BrowseEndpoint?— endpoint for related content (pass toYouTube.related())continuation: String?— token for the next page of queue itemsendpoint: WatchEndpoint— the current or continuation watch endpoint
followAutomixPreview is true (the default), Inner automatically resolves any automix preview at the end of the queue into a full radio continuation, appending those items to the returned items list.
YouTube.next again with the continuation token:
Queue lookup
YouTube.queue(videoIds, playlistId) returns Result<List<SongItem>> for fetching track metadata in bulk by video ID list or by playlist ID. At most YouTube.MAX_GET_QUEUE_SIZE (1000) video IDs may be requested at once.
playlistId to retrieve all tracks associated with a playlist without needing individual video IDs.
Lyrics
YouTube.lyrics(endpoint) takes a BrowseEndpoint obtained from NextResult.lyricsEndpoint and returns Result<String?>. The result is the raw lyrics text, or null if lyrics are unavailable for that track.
Related content
YouTube.related(endpoint) takes a BrowseEndpoint obtained from NextResult.relatedEndpoint and returns Result<RelatedPage>. The RelatedPage data class contains four typed lists:
songs: List<SongItem>albums: List<AlbumItem>artists: List<ArtistItem>playlists: List<PlaylistItem>
Transcript
YouTube.transcript(videoId) returns Result<String> — a plain-text transcript of the video with timestamps. Each line is formatted as [mm:ss.mmm]text. This uses the WEB client (not WEB_REMIX) internally.
Registering playback
YouTube.registerPlayback(playlistId, playbackTracking, authState) pings the playback tracking URL from a PlayerResponse to register a play event for analytics. Call this after starting audio playback.
The playbackTracking string should be taken from PlayerResponse.playbackTracking?.videostatsPlaybackUrl?.baseUrl (or the equivalent field your app uses). Inner normalises the domain from s.youtube.com to music.youtube.com automatically and appends a random client playback nonce (cpn).
Media info
YouTube.getMediaInfo(videoId) returns Result<MediaInfo>. The MediaInfo data class contains metadata and engagement stats for a video:
| Field | Type | Description |
|---|---|---|
videoId | String | The video ID |
title | String? | Video title |
author | String? | Channel name |
authorId | String? | Channel ID |
authorThumbnail | String? | Channel avatar URL |
description | String? | Video description |
uploadDate | String? | Upload date string |
subscribers | String? | Subscriber count text |
viewCount | Int? | View count |
like | Int? | Like count |
dislike | Int? | Dislike count |