InnerTube exposes network configuration options directly on theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/faraasaaay/innertube-v2/llms.txt
Use this file to discover all available pages before exploring further.
YouTube object. Changes take effect immediately — any option that requires rebuilding the HTTP client (proxy, IP version) does so automatically.
HTTP Proxy
SetYouTube.proxy to route all API requests through an HTTP proxy server. The value is a standard java.net.Proxy:
PoTokenWebView, goes through the configured proxy.
Proxy Authentication
If your proxy server requires credentials, setYouTube.proxyAuth with a Proxy-Authorization header value. The library sends this header automatically via an okhttp3.Authenticator on every request that receives an HTTP 407 challenge:
proxyAuth is applied at the OkHttp Authenticator level, not as a static request header. This means credentials are only sent after the proxy issues a 407 challenge, which is the correct behaviour for HTTP proxy authentication.IP Version Filtering
YouTube.ipVersion controls which IP address family is used when resolving hostnames. The library installs a custom okhttp3.Dns implementation that filters the system’s resolved addresses:
| Value | Behaviour |
|---|---|
IpVersion.AUTO | Use all addresses returned by the system DNS (default). |
IpVersion.IPV4 | Prefer IPv4 addresses. Falls back to all addresses if no IPv4 is available. |
IpVersion.IPV6 | Prefer IPv6 addresses. Falls back to all addresses if no IPv6 is available. |
ipVersion rebuilds the HTTP client in the same way as assigning proxy. The same DNS filtering is applied in YTPlayerUtils’s OkHttp instance (used for stream URL validation), so both API calls and CDN probes honour the configured IP version.
Connection Pool and Timeouts
The following settings are configured at client construction time and apply to all InnerTube API requests:| Setting | Value |
|---|---|
| Max idle connections | 10 |
| Connection keep-alive | 5 minutes |
| Connect timeout | 20 seconds |
| Read timeout | 20 seconds |
| Write timeout | 20 seconds |
| Ktor request timeout | 60 seconds |
| Ktor connect timeout | 30 seconds |
| Retry on connection failure | Enabled |
| HTTP/2 | Enabled (preferred alongside HTTP/1.1) |
Retry Logic
Every InnerTube endpoint is wrapped with an exponential-backoff retry loop:- Max attempts: 3
- Initial delay: 500 ms
- Backoff factor: 2.0×
- Retry condition:
java.io.IOException(network errors, socket aborts, timeouts)
delay() throws CancellationException and the loop stops immediately. Errors other than IOException (such as HTTP 4xx responses parsed as exceptions) are not retried.