feat: use refreshtoken instead of api token
This commit is contained in:
@@ -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'
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user