feat: use refreshtoken instead of api token

This commit is contained in:
2026-02-11 02:37:02 -03:00
parent 06926e5601
commit 9025831f3d
2 changed files with 7 additions and 8 deletions
+7 -6
View File
@@ -148,10 +148,7 @@ export class ElevenLabsTTS implements TTSModule {
}
canBeUsed(): boolean {
return (
config.tts_elevenlabs_refreshtoken != undefined &&
config.tts_elevenlabs_key != undefined
);
return config.tts_elevenlabs_refreshtoken != undefined;
}
/*
@@ -176,13 +173,15 @@ export class ElevenLabsTTS implements TTSModule {
}
private async fetchVoices(): Promise<void> {
if (!this.session) return;
const opt: https.RequestOptions = {
hostname: ELEVENLABS_API_ENDPOINT,
path: '/v2/voices',
method: 'GET',
headers: {
Accept: 'application/json',
'xi-api-key': config.tts_elevenlabs_key,
Authorization: `Bearer ${this.session.idToken}`,
'Content-Type': 'application/json'
}
};
@@ -211,13 +210,15 @@ export class ElevenLabsTTS implements TTSModule {
}
private async fetchModels(): Promise<void> {
if (!this.session) return;
const opt: https.RequestOptions = {
hostname: ELEVENLABS_API_ENDPOINT,
path: '/v1/models',
method: 'GET',
headers: {
Accept: 'application/json',
'xi-api-key': config.tts_elevenlabs_key,
Authorization: `Bearer ${this.session.idToken}`,
'Content-Type': 'application/json'
}
};