Comments (3)
另外,刚才测试中出现 translate is not a function 错误。
改为 import { translate as trans_bing } from 'bing-translate-api'; 用 trans_bing 就没错了。遇到过这种问题吗?
暂时没有遇到,也许是其他地方声明了同名变量被覆盖了。
大量并发的情况还没有测试过,不过毕竟是 free to use, 还是建议控制请求频率。
from bing-translate-api.
Hi, 是否是临时的网络问题?我刚刚运行了测试用例,结果显示并无异常。
from bing-translate-api.
我也测了下,只运行测试代码正常。可能是并发大量翻译造成的。
使用 google translate api 也有类似问题。单个测试大概能过。大量请求基本都是 RequestError 。看来还要想办法注册key。
另外,刚才测试中出现 translate is not a function
错误。
改为 import { translate as trans_bing } from 'bing-translate-api';
用 trans_bing 就没错了。遇到过这种问题吗?
下面是 google translation 的错误信息。
GotError [RequestError]: socket hang up
at ClientRequest.<anonymous> (D:\Programming\nodescraping\node_modules\got\source\request-as-event-emitter.js:178:14)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:327:22)
at ClientRequest.origin.emit (D:\Programming\nodescraping\node_modules\@szmarczak\http-timer\source\index.js:37:11)
at TLSSocket.socketOnEnd (_http_client.js:493:9)
at TLSSocket.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'ECONNRESET',
host: 'translate.google.com',
hostname: 'translate.google.com',
method: 'GET',
path: '/',
socketPath: undefined,
protocol: 'https:',
url: 'https://translate.google.com/',
gotOptions: {
path: '/',
protocol: 'https:',
slashes: true,
auth: null,
host: 'translate.google.com',
port: null,
hostname: 'translate.google.com',
hash: null,
search: null,
query: null,
pathname: '/',
href: 'https://translate.google.com/',
retry: {
retries: [Function (anonymous)],
methods: [Set],
statusCodes: [Set],
errorCodes: [Set]
},
headers: {
'user-agent': 'got/9.6.0 (https://github.com/sindresorhus/got)',
'accept-encoding': 'gzip, deflate'
},
hooks: {
beforeRequest: [],
beforeRedirect: [],
beforeRetry: [],
afterResponse: [],
beforeError: [],
init: []
},
decompress: true,
throwHttpErrors: true,
followRedirect: true,
stream: false,
form: false,
json: false,
cache: false,
useElectronNet: false,
agent: TunnelingAgent {
options: [Object],
proxyOptions: [Object],
maxSockets: Infinity,
requests: [],
sockets: [Array],
_events: [Object: null prototype],
_eventsCount: 1,
request: [Function: request],
createSocket: [Function: createSecureSocket],
defaultPort: 443
},
method: 'GET',
forceRefresh: true
}
}
from bing-translate-api.
Related Issues (20)
- why my requset say ,Not response many reqsuet ? HOT 5
- TypeError: Cannot read property '1' of null
- source language NL not recognized HOT 2
- HTTPError: Response code 429 (Too Many Requests) HOT 5
- HttpError: 205 status code (Reset Content) HOT 3
- Something went wrong! The response is {"statusCode":205,"errorMessage":""} HOT 2
- crash: redirects is empty HOT 2
- Response code 404 (Not Found) HOT 2
- v2.9.1 'RequestError' code:'ERR_TLS_CERT_ALTNAME_INVALID' HOT 4
- only call once
- "name":"HTTPError","code":"ERR_NON_2XX_3XX_RESPONSE" HOT 4
- feature request! HOT 7
- Implemented this library using java language HOT 2
- Maximum text lenght is 1000 HOT 10
- please show us a proxy example HOT 3
- [v4 Release] New `MET` Mode for Microsoft Translator
- Browser compatibility HOT 5
- Request code 429 HOT 2
- showing errors in react-native HOT 3
- Not supported Georgian HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bing-translate-api.