-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error at index.js:105:17 #12
Comments
@iromise thx for report, i'll take a look at this problem! |
@lingyv 能看一下这个异常的问题不 |
@iromise 这个错误是在请求 URL 时发生的, 我看不到错误信息, 你在命令行执行下面命令看看错误信息是什么:
|
here is the result, @lingyv ➜ /tmp 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
<!DOCTYPE html><html lang=en><meta charset=utf-8><meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width"><title>Error 403 (Forbidden)!!1</title><style>*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{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}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><a href=//www.google.com/><span id=logo aria-label=Google></span></a><p><b>403.</b> <ins>That’s an error.</ins><p>Your client does not have permission to get URL <code>/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</code> from this server. (Client IP address: 61.148.243.12)<br><br>
<ins>That’s all we know.</ins> |
@iromise can you change the domain from translate.google.cn to translate.google.com, and post the result again? it's looks like you can not access the domain translate.google.cn |
I can not access translate.google.com, but .cn is ok, here is the info ➜ ~ curl https://translate.google.com/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
^C
➜ ~ ping translate.google.cn
PING translate.google.cn (203.208.40.119): 56 data bytes
64 bytes from 203.208.40.119: icmp_seq=0 ttl=112 time=60.784 ms
64 bytes from 203.208.40.119: icmp_seq=1 ttl=112 time=50.756 ms
➜ ~ ping translate.google.com
PING www3-china.l.google.com (74.125.204.139): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2 |
@iromise ummmmm... I'm not sure why you had get message like "Your client does not have permission to get URL." . @lingyv 'll working on this. |
[2018-09-25 17:44:11][ERROR: input.scriptfilter] Code 1: {
"items": [
{
"title": "Error\n at /usr/local/lib/node_modules/alfred-google-translate/node_modules/china-google-translate-api/index.js:105:17\n at process._tickCallback (internal/process/next_tick.js:68:7)",
"subtitle": "Press ⌘L to see the full error and ⌘C to copy it.",
"valid": false,
"text": {
"copy": "```\nError\n at /usr/local/lib/node_modules/alfred-google-translate/node_modules/china-google-translate-api/index.js:105:17\n```\n\n-\nGoogle Translate 1.1.0\nAlfred 3.7\ndarwin x64 18.0.0",
"largetype": "Error\n at /usr/local/lib/node_modules/alfred-google-translate/node_modules/china-google-translate-api/index.js:105:17"
},
"icon": {
"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
}
}
]
}
[2018-09-25 17:44:11][input.scriptfilter] Script with argument 'kate' finished
[2018-09-25 17:44:11][ERROR: input.scriptfilter] Code 1: {
"items": [
{
"title": "Error\n at /usr/local/lib/node_modules/alfred-google-translate/node_modules/china-google-translate-api/index.js:105:17\n at process._tickCallback (internal/process/next_tick.js:68:7)",
"subtitle": "Press ⌘L to see the full error and ⌘C to copy it.",
"valid": false,
"text": {
"copy": "```\nError\n at /usr/local/lib/node_modules/alfred-google-translate/node_modules/china-google-translate-api/index.js:105:17\n```\n\n-\nGoogle Translate 1.1.0\nAlfred 3.7\ndarwin x64 18.0.0",
"largetype": "Error\n at /usr/local/lib/node_modules/alfred-google-translate/node_modules/china-google-translate-api/index.js:105:17"
},
"icon": {
"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
}
}
]
} |
@iromise i don't know why you don't have permission, maybe you can change computer or network and then run that command again. |
@martint028 you got a 403 error ? |
@lingyv yes |
same problem, if anyone can help me?
|
@sailor103 @martint028 if you can access
|
@lingyv After entering this command, there is still the same error |
When is the workflow installed? |
After upgrading to the official version of Mojave |
|
我也遇到了这个问题,curl translate.google.com 或 translate.google.cn 都产生相同错误 |
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. |
@sailor103 @martint028 @iromise @Astraeux Please have a try. |
curl with User Agent is OK. But how to solve this error? |
if it's works, @lingyv 'll update translate-api packages. |
ok, i get it, thank you all. |
line 105:
line 52:
I try change line 52 to:
But it does't work.
|
亲测是china-google-translate-token 这个依赖产生的tk没有作用了。 测试产生的tk是914092.914092。然后 |
这个问题解决了吗?? |
这个问题目前看来应该是api限制的原因,目前还没有好的办法解决 |
为什么我执行curl加上user agent可以成功,但代码加上user agent仍然失败? |
像 @likecreep 说的可能生成的token没用 |
不能用的小伙伴, 可以先用有道翻译 |
ok, thank you, i'll upgrade later |
everybody, i have pushed the update, please upgrade your workflow and try again. |
I just input
tr hello
, it tells me to press command+L to show more details errorError 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
The text was updated successfully, but these errors were encountered: