diff --git a/src/Innertube.ts b/src/Innertube.ts index 6fa45a77..89f03dd2 100644 --- a/src/Innertube.ts +++ b/src/Innertube.ts @@ -48,7 +48,7 @@ export interface SearchFilters { sort_by?: 'relevance' | 'rating' | 'upload_date' | 'view_count'; } -export type InnerTubeClient = 'ANDROID' | 'WEB' | 'YTMUSIC'; +export type InnerTubeClient = 'ANDROID' | 'YTMUSIC_ANDROID' | 'WEB' | 'YTMUSIC'; class Innertube { session; diff --git a/src/core/Session.ts b/src/core/Session.ts index f5525efb..cad0ee47 100644 --- a/src/core/Session.ts +++ b/src/core/Session.ts @@ -13,6 +13,7 @@ export enum ClientType { WEB = 'WEB', MUSIC = 'WEB_REMIX', ANDROID = 'ANDROID', + ANDROID_MUSIC = 'ANDROID_MUSIC' } export interface Context { diff --git a/src/utils/Constants.ts b/src/utils/Constants.ts index 9c6c15c9..c9db7023 100644 --- a/src/utils/Constants.ts +++ b/src/utils/Constants.ts @@ -43,6 +43,10 @@ export const CLIENTS = Object.freeze({ NAME: 'ANDROID', VERSION: '17.17.32', SDK_VERSION: '29' + }, + YTMUSIC_ANDROID: { + NAME: 'ANDROID_MUSIC', + VERSION: '5.17.51' } }); export const STREAM_HEADERS = Object.freeze({ diff --git a/src/utils/HTTPClient.ts b/src/utils/HTTPClient.ts index 5270ac26..6d7b083a 100644 --- a/src/utils/HTTPClient.ts +++ b/src/utils/HTTPClient.ts @@ -137,6 +137,12 @@ export default class HTTPClient { ctx.client.clientName = Constants.CLIENTS.ANDROID.NAME; ctx.client.androidSdkVersion = Constants.CLIENTS.ANDROID.SDK_VERSION; break; + case 'YTMUSIC_ANDROID': + ctx.client.clientVersion = Constants.CLIENTS.YTMUSIC_ANDROID.VERSION; + ctx.client.clientFormFactor = 'SMALL_FORM_FACTOR'; + ctx.client.clientName = Constants.CLIENTS.YTMUSIC_ANDROID.NAME; + ctx.client.androidSdkVersion = Constants.CLIENTS.ANDROID.SDK_VERSION; + break; default: break; }