Coder Social home page Coder Social logo

john-theo / google-translate-server Goto Github PK

View Code? Open in Web Editor NEW
150.0 2.0 25.0 39 KB

[DEPRECATED] Free Google Translate API. Very lightweight and easy to use.

Dockerfile 7.13% JavaScript 92.87%
server google-translate google-translate-api api javascript nodejs express docker deprecated

google-translate-server's Issues

docker-compose部署成功,但查询服务器报400,客户端报403

服务器日志如下:
2020/12/25 07:29:00 [::ffff:172.28.0.1] 400 "Chinese" {to: zh-cn}
客户端日志如下:
ubuntu@VM-0-7-ubuntu:~$ curl http://127.0.0.1:30031/?text=Chinese\&to=zh-cn {"name":"StatusCodeError","statusCode":403,"message":"403 - \"<html lang=en><meta charset=utf-8><meta name=viewport content=\\\"initial-scale=1, minimum-scale=1, width=device-width\\\"><title>Error 403 (禁止访问)!!1</title><style nonce=\\\"LqG/A5Ud/SEQs7rKkL6l0A\\\">*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{color:#222;text-align:unset;margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px;}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}pre{white-space:pre-wrap;}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}</style><div id=\\\"af-error-container\\\"><a href=//www.google.com><span id=logo aria-label=Google></span></a><p><b>403.</b> <ins>出现错误。</ins><p>抱歉,您没有访问此网页的权限。 <ins>这就是我们所知道的全部信息。</ins></div>\"","error":"<html lang=en><meta charset=utf-8><meta name=viewport content=\"initial-scale=1, minimum-scale=1, width=device-width\"><title>Error 403 (禁止访问)!!1</title><style nonce=\"LqG/A5Ud/SEQs7rKkL6l0A\">*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{color:#222;text-align:unset;margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px;}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}pre{white-space:pre-wrap;}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}</style><div id=\"af-error-container\"><a href=//www.google.com><span id=logo aria-label=Google></span></a><p><b>403.</b> <ins>出现错误。</ins><p>抱歉,您没有访问此网页的权限。 <ins>这就是我们所知道的全部信息。</ins></div>","options":{"uri":"https://translate.google.cn/translate_a/single?client=webapp&sl=auto&tl=zh-cn&hl=zh-cn&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&otf=1&ssel=0&tsel=0&kc=7&tk=777933.777933","method":"POST","simple":true,"resolveWithFullResponse":false,"transform2xxOnly":false},"response":{"statusCode":403,"body":"<html lang=en><meta charset=utf-8><meta name=viewport content=\"initial-scale=1, minimum-scale=1, width=device-width\"><title>Error 403 (禁止访问)!!1</title><style nonce=\"LqG/A5Ud/SEQs7rKkL6l0A\">*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{color:#222;text-align:unset;margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px;}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}pre{white-space:pre-wrap;}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}</style><div id=\"af-error-container\"><a href=//www.google.com><span id=logo aria-label=Google></span></a><p><b>403.</b> <ins>出现错误。</ins><p>抱歉,您没有访问此网页的权限。 <ins>这就是我们所知道的全部信息。</ins></div>","headers":{"content-type":"text/html; charset=utf-8","cache-control":"no-cache, no-store, max-age=0, must-revalidate","pragma":"no-cache","expires":"Mon, 01 Jan 1990 00:00:00 GMT","date":"Fri, 25 Dec 2020 07:29:00 GMT","p3p":"CP=\"This is not a P3P policy! See g.co/p3phelp for more info.\"","content-security-policy":"script-src 'report-sample' 'nonce-LqG/A5Ud/SEQs7rKkL6l0A' 'unsafe-inline';object-src 'none';base-uri 'self';report-uri /_/TranslateApiHttp/cspreport;worker-src 'self'","server":"ESF","x-xss-protection":"0","x-content-type-options":"nosniff","set-cookie":["NID=205=iilxZ_WMkdkfKOjv7bqtX5i18UiEiSKIY65HmUcgbpbHsu8JR9pzsLciC6s18AXEeB_YumCwjv9kPCkXUYY39wSQb-ghlifJdHC-xAUTQdTS1542Wl9V5QwEUE8jY1LMySp5vJc4yh7xsFANz4SqSR7S1ODDCtRCJxQibCCA1Gg; expires=Sat, 26-Jun-2021 07:29:00 GMT; path=/; domain=.google.cn; HttpOnly"],"alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","vary":"Accept-Encoding","connection":"close","transfer-encoding":"chunked"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"translate.google.cn","port":443,"hostname":"translate.google.cn","hash":null,"search":"?client=webapp&sl=auto&tl=zh-cn&hl=zh-cn&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&otf=1&ssel=0&tsel=0&kc=7&tk=777933.777933","query":"client=webapp&sl=auto&tl=zh-cn&hl=zh-cn&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&otf=1&ssel=0&tsel=0&kc=7&tk=777933.777933","pathname":"/translate_a/single","path":"/translate_a/single?client=webapp&sl=auto&tl=zh-cn&hl=zh-cn&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&otf=1&ssel=0&tsel=0&kc=7&tk=777933.777933","href":"https://translate.google.cn/translate_a/single?client=webapp&sl=auto&tl=zh-cn&hl=zh-cn&dt=at&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&otf=1&ssel=0&tsel=0&kc=7&tk=777933.777933"},"method":"POST","headers":{"content-type":"application/x-www-form-urlencoded","content-length":9}}}}ubuntu@VM-0-7-ubuntu:~$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.