Spaces:
Running
Running
Mahiruoshi
commited on
Commit
·
42549ab
1
Parent(s):
352a927
Update tools/translate.py
Browse files- tools/translate.py +2 -4
tools/translate.py
CHANGED
@@ -1,8 +1,6 @@
|
|
1 |
"""
|
2 |
翻译api
|
3 |
"""
|
4 |
-
from config import config
|
5 |
-
|
6 |
import random
|
7 |
import hashlib
|
8 |
import requests
|
@@ -17,8 +15,8 @@ def translate(Sentence: str, to_Language: str = "jp", from_Language: str = ""):
|
|
17 |
|
18 |
常见语言代码:中文 zh 英语 en 日语 jp
|
19 |
"""
|
20 |
-
appid =
|
21 |
-
key =
|
22 |
if appid == "" or key == "":
|
23 |
return "请开发者在config.yml中配置app_key与secret_key"
|
24 |
url = "https://fanyi-api.baidu.com/api/trans/vip/translate"
|
|
|
1 |
"""
|
2 |
翻译api
|
3 |
"""
|
|
|
|
|
4 |
import random
|
5 |
import hashlib
|
6 |
import requests
|
|
|
15 |
|
16 |
常见语言代码:中文 zh 英语 en 日语 jp
|
17 |
"""
|
18 |
+
appid = '20231117001883321'
|
19 |
+
key = 'lMQbvZHeJveDceLof2wf'
|
20 |
if appid == "" or key == "":
|
21 |
return "请开发者在config.yml中配置app_key与secret_key"
|
22 |
url = "https://fanyi-api.baidu.com/api/trans/vip/translate"
|