From f9bd5d0e8db39dcb6c68ccc52446fbaa793e04fa Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 14 Mar 2026 04:29:26 -0500 Subject: [PATCH] feat(Session): Add the `ANDROID_VR` client (#1149) --- src/core/Session.ts | 1 + src/types/Misc.ts | 2 +- src/utils/Constants.ts | 11 ++++++++++- src/utils/HTTPClient.ts | 12 ++++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/core/Session.ts b/src/core/Session.ts index 55cec783..302051a6 100644 --- a/src/core/Session.ts +++ b/src/core/Session.ts @@ -26,6 +26,7 @@ export enum ClientType { MUSIC = 'WEB_REMIX', IOS = 'iOS', ANDROID = 'ANDROID', + ANDROID_VR = 'ANDROID_VR', ANDROID_MUSIC = 'ANDROID_MUSIC', ANDROID_CREATOR = 'ANDROID_CREATOR', TV = 'TVHTML5', diff --git a/src/types/Misc.ts b/src/types/Misc.ts index 74e8dbc9..af5b55bd 100644 --- a/src/types/Misc.ts +++ b/src/types/Misc.ts @@ -1,7 +1,7 @@ import type { SessionOptions } from '../core/index.js'; export type InnerTubeConfig = SessionOptions; -export type InnerTubeClient = 'IOS' | 'WEB' | 'MWEB' | 'ANDROID' | 'YTMUSIC' | 'YTMUSIC_ANDROID' | 'YTSTUDIO_ANDROID' | 'TV' | 'TV_SIMPLY' |'TV_EMBEDDED' | 'YTKIDS' | 'WEB_EMBEDDED' | 'WEB_CREATOR'; +export type InnerTubeClient = 'IOS' | 'WEB' | 'MWEB' | 'ANDROID' | 'ANDROID_VR' | 'YTMUSIC' | 'YTMUSIC_ANDROID' | 'YTSTUDIO_ANDROID' | 'TV' | 'TV_SIMPLY' |'TV_EMBEDDED' | 'YTKIDS' | 'WEB_EMBEDDED' | 'WEB_CREATOR'; export type EngagementType = 'ENGAGEMENT_TYPE_UNBOUND' | 'ENGAGEMENT_TYPE_VIDEO_LIKE' | 'ENGAGEMENT_TYPE_VIDEO_DISLIKE' | 'ENGAGEMENT_TYPE_SUBSCRIBE' | 'ENGAGEMENT_TYPE_PLAYBACK' | 'ENGAGEMENT_TYPE_YPC_GET_PREMIUM_PAGE' | 'ENGAGEMENT_TYPE_YPC_GET_DOWNLOAD_ACTION'; export type UploadDate = 'all' | 'today' | 'week' | 'month' | 'year'; diff --git a/src/utils/Constants.ts b/src/utils/Constants.ts index 64b2079a..4c86dafd 100644 --- a/src/utils/Constants.ts +++ b/src/utils/Constants.ts @@ -58,6 +58,14 @@ export const CLIENTS = { SDK_VERSION: 36, USER_AGENT: 'com.google.android.youtube/21.03.36(Linux; U; Android 16; en_US; SM-S908E Build/TP1A.220624.014) gzip' }, + ANDROID_VR: { + NAME: 'ANDROID_VR', + VERSION: '1.65.10', + SDK_VERSION: 32, + DEVICE_MAKE: 'Oculus', + DEVICE_MODEL: 'Quest 3', + USER_AGENT: 'com.google.android.apps.youtube.vr.oculus/1.65.10 (Linux; U; Android 12L; eureka-user Build/SQ3A.220605.009.A1) gzip' + }, YTSTUDIO_ANDROID: { NAME: 'ANDROID_CREATOR', VERSION: '22.43.101' @@ -106,6 +114,7 @@ export const CLIENT_NAME_IDS = { ANDROID: '3', ANDROID_CREATOR: '14', ANDROID_MUSIC: '21', + ANDROID_TV: '28', TVHTML5: '7', TVHTML5_SIMPLY: '74', TVHTML5_SIMPLY_EMBEDDED_PLAYER: '85', @@ -124,4 +133,4 @@ export const INNERTUBE_HEADERS_BASE = { 'content-type': 'application/json' } as const; -export const SUPPORTED_CLIENTS = [ 'IOS', 'WEB', 'MWEB', 'YTKIDS', 'YTMUSIC', 'ANDROID', 'YTSTUDIO_ANDROID', 'YTMUSIC_ANDROID', 'TV', 'TV_SIMPLY', 'TV_EMBEDDED', 'WEB_EMBEDDED', 'WEB_CREATOR' ]; +export const SUPPORTED_CLIENTS = [ 'IOS', 'WEB', 'MWEB', 'YTKIDS', 'YTMUSIC', 'ANDROID', 'ANDROID_VR', 'YTSTUDIO_ANDROID', 'YTMUSIC_ANDROID', 'TV', 'TV_SIMPLY', 'TV_EMBEDDED', 'WEB_EMBEDDED', 'WEB_CREATOR' ]; diff --git a/src/utils/HTTPClient.ts b/src/utils/HTTPClient.ts index 5cb56d68..73d02874 100644 --- a/src/utils/HTTPClient.ts +++ b/src/utils/HTTPClient.ts @@ -254,6 +254,18 @@ export default class HTTPClient { ctx.client.clientFormFactor = 'SMALL_FORM_FACTOR'; ctx.client.clientName = Constants.CLIENTS.ANDROID.NAME; break; + case 'ANDROID_VR': + ctx.client.androidSdkVersion = 32; + ctx.client.osName = 'Android'; + ctx.client.osVersion = '12L'; + ctx.client.platform = 'MOBILE'; + ctx.client.userAgent = Constants.CLIENTS.ANDROID_VR.USER_AGENT; + ctx.client.deviceMake = Constants.CLIENTS.ANDROID_VR.DEVICE_MAKE; + ctx.client.deviceModel = Constants.CLIENTS.ANDROID_VR.DEVICE_MODEL; + ctx.client.clientVersion = Constants.CLIENTS.ANDROID_VR.VERSION; + ctx.client.clientFormFactor = 'SMALL_FORM_FACTOR'; + ctx.client.clientName = Constants.CLIENTS.ANDROID_VR.NAME; + break; case 'YTMUSIC_ANDROID': ctx.client.clientVersion = Constants.CLIENTS.YTMUSIC_ANDROID.VERSION; ctx.client.clientFormFactor = 'SMALL_FORM_FACTOR';