Comments (6)
normalizedAddTorrent will do it, addMagnet only returns what qbittorrent api gives back, a mostly useless boolean.
from qbittorrent.
You might also get the hash yourself, see how its done here
qbittorrent/src/qbittorrent.ts
Line 599 in 10e9a79
from qbittorrent.
Thanks. Does normalizedAddTorrent work with magnet urls too? If so, I couldn't get it to work. It throws an error and says "Error: not a number: buffer['0'] = 104"
Could it be because my input is actually not a magnet file? Because what I'm using as parameter is actually just a "download URL" for the torrent file. Does this count as magnet? When I use addMagnet function with this url it works btw.
And for the second method does it work with this url? Once again I tried it but it throw an error.
from qbittorrent.
You're probably adding by url then. I'm not sure how you would get the hash except by comparing the current set of torrents with the new set of torrents after adding the torrent. Another solution might be to download the torrent file in your code and pass that to add normalized torrent.
from qbittorrent.
Comparing the torrents and getting the hash is what I currently do. But sometimes it just doesn't work
and loads the wrong torrent for some reason. And its not best the best solution either. I could also download the torrent file and add it by file, but this would also make things more complicated. So are you confirming that this method is not supposed to work anyway?
I call it like this:
const result = await client.normalizedAddTorrent("https://....blablabla.torrent", { savepath: savepath, sequentialDownload:"True", paused:"False" }) // throws the error I shared above.
But the below code just works, and returns true.
const result = await client.addMagnet("https://....blablabla.torrent", { savepath: savepath, sequentialDownload:"True", paused:"False" })
from qbittorrent.
yeah add magnet is using the same api as add by url. normalizedAddTorrent can't support urls since there isn't a way to return the hash. maybe it should throw an error.
from qbittorrent.
Related Issues (20)
- The requested module '@ctrl/url-join' does not provide an export named 'urlJoin' HOT 11
- Torrent State `downloading` not working, showing `unknown` instead HOT 3
- Getting `Error: Cookie not found. Auth Failed.` after using it for a while HOT 1
- Critical dependency warning HOT 3
- Rename Folder Method HOT 1
- add torrent via url? HOT 1
- Make _normalizeTorrentData public or include raw torrent data in normalized object HOT 1
- `listTorrents` doesn't respect empty strings as valid inputs for `category` and `tag` HOT 2
- HTTPError: Response code 405 (Method Not Allowed) HOT 1
- Get torrent peers data HOT 1
- the expiration time is a long time in the future HOT 1
- Long-lived clients do not handle session cookie expiration HOT 2
- The `body` option must be a stream.Readable, string or Buffer
- Problem importing from `types` HOT 3
- got v12
- removeTorrent is not normalized HOT 1
- Add tag optional parameter to /torrents/info HOT 2
- 'add_trackers' and some other fields are missing in types HOT 1
- option root_folder not working on addMagnet 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 qbittorrent.