Spaces:
Running
Running
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -26,14 +26,14 @@ else:
|
|
26 |
|
27 |
def translate(text,lang):
|
28 |
resp = requests.post(
|
29 |
-
url = "https://www.bing.com/ttranslatev3?isVertical=1&&IG=13172331D0494B12ABFA8F4454EEB479&IID=translator.5026",
|
30 |
-
"referrer"
|
31 |
-
"referrerPolicy"
|
32 |
-
"data"
|
33 |
-
"method"
|
34 |
-
"mode"
|
35 |
-
"credentials"
|
36 |
-
"headers"
|
37 |
"accept": "*/*",
|
38 |
"accept-language": "en-US,en;q=0.9,he;q=0.8,ha;q=0.7",
|
39 |
"content-type": "application/x-www-form-urlencoded",
|
|
|
26 |
|
27 |
def translate(text,lang):
|
28 |
resp = requests.post(
|
29 |
+
"url" = "https://www.bing.com/ttranslatev3?isVertical=1&&IG=13172331D0494B12ABFA8F4454EEB479&IID=translator.5026",
|
30 |
+
"referrer" = "https://www.bing.com/translator?to=en",
|
31 |
+
"referrerPolicy" = "origin-when-cross-origin",
|
32 |
+
"data" = f"&fromLang=auto-detect&to={lang}}&token=cdkbEXg93_iQE28MFPv9ScrPY_fs2OAw&key=1722124106496&text={text}&tryFetchingGenderDebiasedTranslations=true",
|
33 |
+
"method" = "POST",
|
34 |
+
"mode" = "cors",
|
35 |
+
"credentials" = "include"
|
36 |
+
"headers" = {
|
37 |
"accept": "*/*",
|
38 |
"accept-language": "en-US,en;q=0.9,he;q=0.8,ha;q=0.7",
|
39 |
"content-type": "application/x-www-form-urlencoded",
|