Skip to content

Commit

Permalink
新增第三方Deepl Api接口
Browse files Browse the repository at this point in the history
仅通过密钥格式对接口选择进行判断
  • Loading branch information
lol2025 authored Sep 11, 2023
1 parent 6c80ab0 commit be7681d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/services/deepl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const deeplfree = <TranslateTaskProcessor>async function (data) {
};

export const deeplpro = <TranslateTaskProcessor>async function (data) {
return await deepl("https://api.deepl.com/v2/translate", data);
return await deepl(data.secret.endsWith('dp')?"https://api.deepl-pro.com/v2/translate":"https://api.deepl.com/v2/translate", data);
};

async function deepl(url: string, data: Required<TranslateTask>) {
Expand Down

0 comments on commit be7681d

Please sign in to comment.