diff --git a/src/core/Player.ts b/src/core/Player.ts index dc6de872..4c5fd43c 100644 --- a/src/core/Player.ts +++ b/src/core/Player.ts @@ -146,12 +146,6 @@ export default class Player { case 'WEB_KIDS': url_components.searchParams.set('cver', Constants.CLIENTS.WEB_KIDS.VERSION); break; - case 'ANDROID': - url_components.searchParams.set('cver', Constants.CLIENTS.ANDROID.VERSION); - break; - case 'ANDROID_MUSIC': - url_components.searchParams.set('cver', Constants.CLIENTS.YTMUSIC_ANDROID.VERSION); - break; case 'TVHTML5_SIMPLY_EMBEDDED_PLAYER': url_components.searchParams.set('cver', Constants.CLIENTS.TV_EMBEDDED.VERSION); break; diff --git a/src/core/Session.ts b/src/core/Session.ts index 21d89d24..dc823ccb 100644 --- a/src/core/Session.ts +++ b/src/core/Session.ts @@ -21,6 +21,7 @@ export enum ClientType { ANDROID = 'ANDROID', ANDROID_MUSIC = 'ANDROID_MUSIC', ANDROID_CREATOR = 'ANDROID_CREATOR', + TV = 'TVHTML5', TV_EMBEDDED = 'TVHTML5_SIMPLY_EMBEDDED_PLAYER', WEB_EMBEDDED = 'WEB_EMBEDDED_PLAYER', WEB_CREATOR = 'WEB_CREATOR' diff --git a/src/types/Misc.ts b/src/types/Misc.ts index 28ac68cd..ba6012cf 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' | 'ANDROID' | 'YTMUSIC' | 'YTMUSIC_ANDROID' | 'YTSTUDIO_ANDROID' | 'TV_EMBEDDED' | 'YTKIDS' | 'WEB_EMBEDDED' | 'WEB_CREATOR'; +export type InnerTubeClient = 'IOS' | 'WEB' | 'ANDROID' | 'YTMUSIC' | 'YTMUSIC_ANDROID' | 'YTSTUDIO_ANDROID' | 'TV' | 'TV_EMBEDDED' | 'YTKIDS' | 'WEB_EMBEDDED' | 'WEB_CREATOR'; export type UploadDate = 'all' | 'hour' | 'today' | 'week' | 'month' | 'year'; export type SearchType = 'all' | 'video' | 'channel' | 'playlist' | 'movie'; diff --git a/src/utils/Constants.ts b/src/utils/Constants.ts index 56ff9b7b..f96eceeb 100644 --- a/src/utils/Constants.ts +++ b/src/utils/Constants.ts @@ -51,9 +51,9 @@ export const CLIENTS = Object.freeze({ ANDROID: { NAME_ID: '3', NAME: 'ANDROID', - VERSION: '18.48.37', + VERSION: '19.35.36', SDK_VERSION: 33, - USER_AGENT: 'com.google.android.youtube/18.48.37(Linux; U; Android 13; en_US; sdk_gphone64_x86_64 Build/UPB4.230623.005) gzip' + USER_AGENT: 'com.google.android.youtube/19.35.36(Linux; U; Android 13; en_US; SM-S908E Build/TP1A.220624.014) gzip' }, YTSTUDIO_ANDROID: { NAME_ID: '14', @@ -65,6 +65,12 @@ export const CLIENTS = Object.freeze({ NAME: 'ANDROID_MUSIC', VERSION: '5.34.51' }, + TV: { + NAME_ID: '7', + NAME: 'TVHTML5', + VERSION: '7.20241016.15.00', + USER_AGENT: 'Mozilla/5.0 (ChromiumStylePlatform) Cobalt/Version' + }, TV_EMBEDDED: { NAME_ID: '85', NAME: 'TVHTML5_SIMPLY_EMBEDDED_PLAYER', @@ -99,4 +105,4 @@ export const INNERTUBE_HEADERS_BASE = Object.freeze({ 'content-type': 'application/json' }); -export const SUPPORTED_CLIENTS = [ 'IOS', 'WEB', 'YTKIDS', 'YTMUSIC', 'ANDROID', 'YTSTUDIO_ANDROID', 'YTMUSIC_ANDROID', 'TV_EMBEDDED', 'WEB_EMBEDDED', 'WEB_CREATOR' ]; +export const SUPPORTED_CLIENTS = [ 'IOS', 'WEB', 'YTKIDS', 'YTMUSIC', 'ANDROID', 'YTSTUDIO_ANDROID', 'YTMUSIC_ANDROID', 'TV', 'TV_EMBEDDED', 'WEB_EMBEDDED', 'WEB_CREATOR' ]; \ No newline at end of file diff --git a/src/utils/HTTPClient.ts b/src/utils/HTTPClient.ts index 1b34dc42..f891cd7a 100644 --- a/src/utils/HTTPClient.ts +++ b/src/utils/HTTPClient.ts @@ -217,6 +217,12 @@ export default class HTTPClient { ctx.client.clientFormFactor = 'SMALL_FORM_FACTOR'; ctx.client.clientName = Constants.CLIENTS.YTSTUDIO_ANDROID.NAME; break; + case 'TV': { + ctx.client.clientVersion = Constants.CLIENTS.TV.VERSION; + ctx.client.clientName = Constants.CLIENTS.TV.NAME; + ctx.client.userAgent = Constants.CLIENTS.TV.USER_AGENT; + break; + } case 'TV_EMBEDDED': ctx.client.clientName = Constants.CLIENTS.TV_EMBEDDED.NAME; ctx.client.clientVersion = Constants.CLIENTS.TV_EMBEDDED.VERSION;