How caya8205-2/innertube-rs works
innertube-rs is an asynchronous Rust client and CLI for YouTube’s InnerTube API. The main workflow is a caller using the public client to request metadata, search, or a stream; endpoint code sends requests through a session, then parses responses into typed results. Stream resolution additionally selects formats and uses the embedded decipher engine. The README documents broader endpoint coverage—including Music, comments, live chat, and transcripts—which is retained here. Some endpoint implementations were not sampled, so their internal links are omitted.
Main entry points: lib.rs Innertube Client · search.rs Search Endpoint · player.rs Player Endpoint · session.rs HTTP Session
Components 26
Client Interface
- Innertube Client
src/lib.rs - Command-Line Client
src/bin/cli.rs
API Endpoints
- Search Endpoint
src/endpoints/search.rs - Player Endpoint
src/endpoints/player.rs - Music Endpoints
src/endpoints/music.rs - Playlist Endpoint
src/endpoints/playlist.rs - Other API Endpoints
src/endpoints/mod.rs
Parsing and Models
- Response Parser
src/parser/mod.rs - Node Registry
src/parser/registry.rs - Renderer Nodes
src/parser/nodes/mod.rs - Video Nodes
src/parser/nodes/video.rs - Music Nodes
src/parser/nodes/music.rs - Playlist Nodes
src/parser/nodes/playlist.rs - Text Nodes
src/parser/nodes/misc/text.rs - Video Models
src/models/video.rs - Stream Format Models
src/models/format.rs - Music Models
src/models/music.rs
Request and Media Runtime
- HTTP Session
src/core/session.rs - Protobuf Encoding
src/utils/proto.rs - Player Deciphering
src/utils/decipher.rs - Stream Resolution
src/utils/streaming_info.rs - Session Actions
src/core/actions.rs - OAuth Device Flow
src/core/oauth.rs
Other components
- Library Caller
- YouTube InnerTube
- Google OAuth
Connections 23
- Library Caller → Innertube Client: calls
- Innertube Client → Search Endpoint: invokes
src/lib.rs - Innertube Client → Player Endpoint: invokes
src/lib.rs - Innertube Client → Music Endpoints: invokes
src/lib.rs - Innertube Client → Playlist Endpoint: invokes
src/lib.rs - Innertube Client → Other API Endpoints: exposes
src/lib.rs - Command-Line Client → Innertube Client: uses
- Search Endpoint → HTTP Session: posts request
src/endpoints/search.rs - Player Endpoint → HTTP Session: requests player data
src/endpoints/player.rs - HTTP Session → YouTube InnerTube: sends HTTP
src/core/session.rs - Search Endpoint → Response Parser: parses response
src/endpoints/search.rs - Search Endpoint → Protobuf Encoding: encodes filters
src/endpoints/search.rs - Response Parser → Node Registry: dispatches nodes
src/parser/mod.rs - Response Parser → Renderer Nodes: parses nodes
src/parser/mod.rs - Music Nodes → Text Nodes: uses text
src/parser/nodes/music.rs - Playlist Nodes → Text Nodes: uses text
src/parser/nodes/playlist.rs - Player Endpoint → Player Deciphering: deciphers streams
src/endpoints/player.rs - Player Endpoint → Stream Format Models: selects formats
src/endpoints/player.rs - Video Models → Stream Format Models: uses formats
src/models/video.rs - Stream Resolution → Player Deciphering: uses decipher
src/utils/streaming_info.rs - Session Actions → HTTP Session: uses session
src/core/actions.rs - Session Actions → Protobuf Encoding: encodes payloads
src/core/actions.rs - OAuth Device Flow → Google OAuth: requests tokens
src/core/oauth.rs