scttcper / deluge Goto Github PK
View Code? Open in Web Editor NEWDeluge API wrapper
Home Page: https://deluge.vercel.app
License: MIT License
Deluge API wrapper
Home Page: https://deluge.vercel.app
License: MIT License
It seems that Deluge torrents give me their progress out of 100, but the other clients give their percentage it out of 1. Is that a bug ?
It's weird because when I hover on the NormalizedTorrent.progress
in VsCode it shows me progress percent out of 100
I've been using this
delugeTorrents.forEach((delugeTorrent) =>
torrents.push({ ...delugeTorrent, progress: delugeTorrent.progress / 100 })
);
In my code to "fix" that difference.
Could you tell me why I seem to have these differences ? (I'm integrating qbit/deluge/transmission integrations in my app)
const status = await deluge.getTorrentStatus(HASH_THAT_DOES_NOT_EXIST);
The above will hang for timeout
ms and then throw:
Timeout awaiting 'request' for 1000ms
Is there anyway we can get this to return null instantly or throw instantly? Surely the deluge web API doesn't just hang when requesting a non-existent torrent? Lol I hope not.
Add by url is missing
Is it possible to add a torrent via magnet and set its label? Or any way in general to set labels?
I would like to use this lib in the browser. Could you allow another HTTP client to be used in place of got (like perhaps ky) so that browser usage is possible? I will write this, are you open to a PR?
(node:4347) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined
at Deluge.addTorrent (/home/yakubo/nyaa-dl/node_modules/@ctrl/deluge/src/index.ts:272:27)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
(node:4347) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not ha)
(node:4347) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I get this error when trying to add a new torrent. I see the fault lies in this line:
const res = await this.request<AddTorrentResponse>('web.add_torrents', [[{ path, options }]]);
if (res.body.result[0][0] === false) {
throw new Error('Failed to add torrent');
}
It cannot find [0]
of res.body.result[0]
cuz it is already undefined. So, I checked the output of this response manually and I found res.body.result
returns to be a boolean value for this request. The following is a response I found when manually making the request.
{"id": 3841, "result": null, "error": null}
So, I am fixing this in my PR for the issue #69 by replacing the above code with the following:
const res = await this.request<AddTorrentResponse>('web.add_torrents', [[{ path, options }]]);
if (res.body.result === false) {
throw new Error('Failed to add torrent');
}
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can resolve this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
package.json
file.A package.json file at the root of your project is required to release on npm.
Please follow the npm guideline to create a valid package.json
file.
Good luck with your project β¨
Your semantic-release bot π¦π
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.