Skip to content

Commit

Permalink
feat(Session): Add configInfo to InnerTube context
Browse files Browse the repository at this point in the history
Minor addition. It's needed for certain UMP requests.
  • Loading branch information
LuanRT committed Jul 1, 2024
1 parent a19511d commit 5a8fd3a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export type Context = {
isWebNativeShareAvailable: boolean;
};
memoryTotalKbytes?: string;
configInfo?: {
appInstallData: string;
},
kidsAppInfo?: {
categorySettings: {
enabledCategories: string[];
Expand Down Expand Up @@ -97,6 +100,7 @@ type ContextData = {
enable_safety_mode: boolean;
browser_name?: string;
browser_version?: string;
app_install_data?: string;
device_make: string;
device_model: string;
on_behalf_of_user?: string;
Expand Down Expand Up @@ -435,6 +439,9 @@ export default class Session extends EventEmitter {

const [ [ device_info ], api_key ] = ytcfg;

const config_info = device_info[61];
const app_install_data = config_info[config_info.length - 1];

const context_info = {
hl: options.lang || device_info[0],
gl: options.location || device_info[2],
Expand All @@ -450,6 +457,7 @@ export default class Session extends EventEmitter {
browser_version: device_info[87],
device_make: device_info[11],
device_model: device_info[12],
app_install_data: app_install_data,
enable_safety_mode: options.enable_safety_mode
};

Expand Down Expand Up @@ -499,6 +507,9 @@ export default class Session extends EventEmitter {
}
};

if (args.app_install_data)
context.client.configInfo = { appInstallData: args.app_install_data };

if (args.on_behalf_of_user)
context.user.onBehalfOfUser = args.on_behalf_of_user;

Expand Down

0 comments on commit 5a8fd3a

Please sign in to comment.