dd-center / ddathome-nodejs Goto Github PK
View Code? Open in Web Editor NEWDD@Home in nodejs
License: MIT License
DD@Home in nodejs
License: MIT License
Currently, we have to set env variables for configuration:
cmd /c "SET VERBOSE=1 && SET INTERVAL=2000 && npx dd-center/DDatHome-nodejs"
It will be nice if we can pass them to the CLI directly:
npx dd-center/DDatHome-nodejs --verbose --interval 2000
I can file a PR using neodoc if you like.
最新的v1.8.3版本上报的还是v1.8.2
Line 76 in b4f3006
这行参数需要增加process.arch变量
效果如 linux-amd64
大概修改成这样
url.searchParams.set('platform', '${process.platform}-${process.arch}')
So users can run this tool by simply executing the npx command:
npx dd-center/DDatHome-nodejs
运行ddathome-nodejs-1.8.1时报错。不影响运行。
Linux内核版本:v3.4.5
node版本:v14.15.0 (node16似乎无法正常运行?)
ddathome版本:v1.8.1
原始报错:
https://www.verybin.com/?5178f4dac81503ba#shRcaNFVrIAj1YUyKMTwZk0m/T2yEibpkBd1zSQ3PUw=
加入 --trace-warnings 后的报错:
https://www.verybin.com/?92953b7f0a6cfd02#GN5Z2e4S9Uf3zl45LabarCVc0MsZ/rx37K+kvqXkdqM=
Some code is duplicated with https://github.com/dd-center/DDatElectron/blob/3d76a744219360debe35cdb6772d9f8d79b4b4be/src/ws.js
I think we can make DDatHome-nodejs more modular, so DDatElectron can use it. Imagine something like:
const ddCore = require("DDatHome-nodejs");
ddCore.startDD({
interval: await getInterval()
runtime: `DDatHomeCore ${ddCore.version}, DDatElectron ${...}, Electron ${...}`,
... // and other configurable options
onlog(logLevel, message) {
// redirect log to the UI
}
});
It also helps #1 by making the current code more modular,
最近b站给 https://api.bilibili.com/x/space/acc/info 加了反爬
被拦截的请求会返回 -401 非法访问
初步摸索到的解决方法:给请求加上有效的User-Agent和值不为空的Cookie
Currently, it relies on the close
event and it doesn't detect broken connection. Sometimes it hangs when the connection is lost. It might be better to switch to something like pws.
Since we have DDDhttp
, we can set a pingTimeout
to reconnect automatically.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.