fix soundcloud account validation, bump version

This commit is contained in:
uh wot
2024-10-09 02:04:22 +02:00
parent b6a9ac9ca3
commit 29719ef5d9
2 changed files with 17 additions and 14 deletions

View File

@@ -278,20 +278,23 @@ export default class Soundcloud implements Streamer {
return { ...api, id }
}
async getAccountInfo(): Promise<StreamerAccount> {
if (!this.oauthToken) return { valid: false }
const client = this.client || (await this.#getClient())
const subscriptionQuery = <SoundCloudSubscriptionData>await (
await fetch(
this.#formatURL(
`https://api-v2.soundcloud.com/payments/quotations/consumer-subscription`,
client
),
{
method: 'get',
headers: headers(this.oauthToken),
dispatcher: this.dispatcher
}
)
).json()
const response = await fetch(
this.#formatURL(
`https://api-v2.soundcloud.com/payments/quotations/consumer-subscription`,
client
),
{
method: 'get',
headers: headers(this.oauthToken),
dispatcher: this.dispatcher
}
)
if (response.status != 200) return { valid: false }
const subscriptionQuery = <SoundCloudSubscriptionData>await response.json()
return {
valid: true,