mirror of
https://git.gay/lucida/lucida
synced 2025-12-11 20:15:14 +01:00
bug fix for tidal account checker
This commit is contained in:
parent
918c618d74
commit
c5ed329e49
@ -42,6 +42,8 @@ interface LoginData {
|
||||
interface SessionData {
|
||||
countryCode: string
|
||||
userId: number
|
||||
status?: number
|
||||
userMessage?: string
|
||||
}
|
||||
|
||||
interface SubscriptionData {
|
||||
@ -419,7 +421,16 @@ export default class Tidal implements Streamer {
|
||||
}
|
||||
}
|
||||
async getAccountInfo(): Promise<StreamerAccount> {
|
||||
if (!this.userId) await this.getCountryCode()
|
||||
if (this.userId == undefined || this.countryCode == undefined) {
|
||||
if (Date.now() > this.expires) await this.refresh()
|
||||
const sessionResponse = await fetch('https://api.tidal.com/v1/sessions', {
|
||||
headers: this.headers()
|
||||
})
|
||||
const sessionData = <SessionData>await sessionResponse.json()
|
||||
|
||||
this.userId = sessionData.userId
|
||||
this.countryCode = sessionData.countryCode
|
||||
}
|
||||
const subscription = <SubscriptionData>(
|
||||
await this.#get(`users/${this.userId}/subscription`, {}, TIDAL_SUBSCRIPTION_BASE)
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user