add Google-free translate failed warnning
This commit is contained in:
@@ -467,6 +467,9 @@ def translate(
|
|||||||
+ src
|
+ src
|
||||||
)
|
)
|
||||||
result = get_html(url=url, return_type="object")
|
result = get_html(url=url, return_type="object")
|
||||||
|
if not result.ok:
|
||||||
|
print('[-]Google-free translate web API calling failed.')
|
||||||
|
return ''
|
||||||
|
|
||||||
translate_list = [i["trans"] for i in result.json()["sentences"]]
|
translate_list = [i["trans"] for i in result.json()["sentences"]]
|
||||||
trans_result = trans_result.join(translate_list)
|
trans_result = trans_result.join(translate_list)
|
||||||
|
|||||||
Reference in New Issue
Block a user