alfred-google-translate: Error at index.js:105:17

I just input tr hello, it tells me to press command+L to show more details error

Error at /usr/local/lib/node_modules/alfred-google-translate/node_modules/china-google-translate-api/index.js:105:17 at <anonymous>

My nodejs version is

➜  china-google-translate-api npm --version
5.6.0

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 36 (20 by maintainers)

Most upvoted comments

look at this issues, and try this way

Maybe the problem is missing User Agent:

curl -A "Mozilla/5.0" "https://translate.google.cn/translate_a/single?client=t&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&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=7&q=hello&tk=970599.543581"

Return is OK.

curl "https://translate.google.cn/translate_a/single?client=t&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&ie=UTF-8&oe=UTF-8&otf=1&ssel=0&tsel=0&kc=7&q=hello&tk=970599.543581"

Return is 403.

不能用的小伙伴, 可以先用有道翻译