plz
This commit is contained in:
hazycora
2024-07-29 12:11:45 -04:00
parent 0374719328
commit 135856800f
2 changed files with 37 additions and 28 deletions

View File

@@ -80,7 +80,10 @@ export default class Deezer implements StreamerWithLogin {
if (options?.arl) this.#loginViaArl(options.arl)
}
async #apiCall<T extends keyof APIMethod>(method: T, data: { [key: string]: string | number | string[] } = {}): Promise<APIMethod[T]> {
async #apiCall<T extends keyof APIMethod>(
method: T,
data: { [key: string]: string | number | string[] } = {}
): Promise<APIMethod[T]> {
let apiToken = this.apiToken
if (method == 'deezer.getUserData' || method == 'user.getArl') apiToken = ''
@@ -93,7 +96,7 @@ export default class Deezer implements StreamerWithLogin {
})}`
interface DeezerResponse {
results: APIMethod[T];
results: APIMethod[T]
error: number[] | { [key: string]: string }
}

View File

@@ -15,13 +15,19 @@ export interface DeezerLoginResponse {
}
export interface DeezerMediaResponse {
data: [{
media: [{
sources: [{
data: [
{
media: [
{
sources: [
{
url: string
}]
}]
}]
}
]
}
]
}
]
}
export interface DeezerUserData {