some test changes
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
#!/usr/bin/pyhton3
|
||||
import requests
|
||||
import time
|
||||
from random import randint
|
||||
|
||||
|
||||
|
||||
def translate(_input, lang='RU'):
|
||||
url = "https://www2.deepl.com/jsonrpc"
|
||||
_id = randint(10000000, 99999999)
|
||||
|
||||
r = requests.post(
|
||||
url,
|
||||
@@ -29,8 +32,14 @@ def translate(_input, lang='RU'):
|
||||
"commonJobParams": {},
|
||||
"timestamp": int(round(time.time() * 1000))
|
||||
},
|
||||
"id": 40890009
|
||||
"id": 40890008
|
||||
}
|
||||
)
|
||||
print(r.json())
|
||||
return r.json()['result']['translations'][0]['beams'][0]['postprocessed_sentence']
|
||||
print(_id)
|
||||
try:
|
||||
return r.json()['result']['translations'][0]['beams'][0]['postprocessed_sentence']
|
||||
except:
|
||||
print(r.json())
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user