streივam სinfo emostly లాdone

This commit is contained in:
Reid 2025-04-22 23:40:21 -07:00
parent 237ec061d2
commit 4954f84a48
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
5 changed files with 193 additions and 139 deletions

View file

@ -46,7 +46,7 @@ export default class AppleMusicApi {
async getWebplayback(
trackId: string
): Promise<unknown> {
): Promise<WebplaybackResponse> {
return (await this.http.post(webplaybackApiUrl, {
salableAdamId: trackId,
language: config.downloader.api.language
@ -57,7 +57,7 @@ export default class AppleMusicApi {
trackId: string,
trackUri: string,
challenge: string
): Promise<{ license: string | undefined }> {
): Promise<WidevineLicenseResponse> {
return (await this.http.post(licenseApiUrl, {
challenge: challenge,
"key-system": "com.widevine.alpha",
@ -72,3 +72,8 @@ export default class AppleMusicApi {
}})).data;
}
}
// these are super special types
// i'm not putting this in the ./types folder.
export type WebplaybackResponse = { songList: { assets: { flavor: string, URL: string }[], songId: string }[] };
export type WidevineLicenseResponse = { license: string | undefined };