fix(PlayerEndpoint): Workaround for "The following content is not available on this app" (Android) (#624)

* chore: Update Android client version and UA

* refactor: Update shorts parameter protobuf

* chore: Update auto generated files

* chore: Add test

* chore: Update comments test id (unrelated)

* chore: Update comments test again (unrelated)
This commit is contained in:
Luan
2024-03-31 11:35:12 -03:00
committed by GitHub
parent 45f33d8c04
commit d589365ea2
11 changed files with 249 additions and 32 deletions

View File

@@ -33,25 +33,25 @@ export interface Context {
hl: string;
gl: string;
remoteHost?: string;
screenDensityFloat: number;
screenHeightPoints: number;
screenPixelDensity: number;
screenWidthPoints: number;
visitorData: string;
screenDensityFloat?: number;
screenHeightPoints?: number;
screenPixelDensity?: number;
screenWidthPoints?: number;
visitorData?: string;
clientName: string;
clientVersion: string;
clientScreen?: string,
androidSdkVersion?: string;
androidSdkVersion?: number;
osName: string;
osVersion: string;
platform: string;
clientFormFactor: string;
userInterfaceTheme: string;
userInterfaceTheme?: string;
timeZone: string;
userAgent?: string;
browserName?: string;
browserVersion?: string;
originalUrl: string;
originalUrl?: string;
deviceMake: string;
deviceModel: string;
utcOffsetMinutes: number;
@@ -73,6 +73,10 @@ export interface Context {
thirdParty?: {
embedUrl: string;
};
request?: {
useSsl: boolean;
internalExperimentFlags: any[];
};
}
export interface SessionOptions {
@@ -327,11 +331,17 @@ export default class Session extends EventEmitter {
},
user: {
enableSafetyMode: options.enable_safety_mode,
lockedSafetyMode: false,
onBehalfOfUser: options.on_behalf_of_user
lockedSafetyMode: false
},
request: {
useSsl: true,
internalExperimentFlags: []
}
};
if (options.on_behalf_of_user)
context.user.onBehalfOfUser = options.on_behalf_of_user;
return { context, api_key, api_version };
}
@@ -366,11 +376,17 @@ export default class Session extends EventEmitter {
},
user: {
enableSafetyMode: options.enable_safety_mode,
lockedSafetyMode: false,
onBehalfOfUser: options.on_behalf_of_user
lockedSafetyMode: false
},
request: {
useSsl: true,
internalExperimentFlags: []
}
};
if (options.on_behalf_of_user)
context.user.onBehalfOfUser = options.on_behalf_of_user;
return { context, api_key: Constants.CLIENTS.WEB.API_KEY, api_version: Constants.CLIENTS.WEB.API_VERSION };
}