Giter Club home page Giter Club logo

qbittorrent's People

Contributors

dependabot[bot] avatar eephrati avatar hammerturtle avatar ouuan avatar renovate-bot avatar renovate[bot] avatar sachaw avatar scttcper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

qbittorrent's Issues

Critical dependency warning

I'm getting this warning all the time:

warn  - ../node_modules/@ctrl/qbittorrent/node_modules/keyv/src/index.js
Critical dependency: the request of a dependency is an expression

Doesn't Support Commonjs

I was using another qBittorent package for my app that supports Commonjs. But this package doesn't support Commonjs and my typescript code is compiling to Commonjs and I can't change the typescript code to emit esm module JavaScript because the codebase is extremely large and I don't want to break other things.

Any walk around?

got v12

make the switch to ESM, might I suggest form-data-encoder and
formdata-node as a modern replacement for formdata.

Further info: sindresorhus/got#1877

Potential issue when using Automatic torrent management by default

it appears that when setting the Default Torrent management mode to Automatic as against Manual:
image

the savepath parameter is ignored by QBT, unless autoTMM is set to false

not sure what other parameters it affects, but may be good to always pass autoTTM: false when savepath is set.

The requested module '@ctrl/url-join' does not provide an export named 'urlJoin'

The basic example doesn't work

My main.ts

import { QBittorrent } from '@ctrl/qbittorrent';

const client = new QBittorrent({
  baseUrl: 'http://localhost:8080/',
  username: 'admin',
  password: 'adminadmin',
});

async function main() {
  const res = await client.getAllData();
  console.log(res);
}

main()

The error

$ ts-node ./src/main.ts
file:///C:/Users/<Name>/<programming folder>/node_modules/@ctrl/qbittorrent/dist/src/qbittorrent.js:12
import { urlJoin } from '@ctrl/url-join';
         ^^^^^^^
SyntaxError: The requested module '@ctrl/url-join' does not provide an export named 'urlJoin'       
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:128:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:194:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:409:24)
    at async loadESM (node:internal/process/esm_loader:85:5)
    at async handleMainPromise (node:internal/modules/run_main:61:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command

HTTPError: Response code 405 (Method Not Allowed)

All API methods only allows GET or POST methods. Use POST when you are mutating some state (or when your request is too big to fit into GET) and use GET otherwise. Starting with qBittorrent v4.4.4, server will return 405 Method Not Allowed when you used the wrong request method.

removeTorrent, pauseTorrent, resumeTorrent.....

The `body` option must be a stream.Readable, string or Buffer

Hello,

I have the following error Uncaught (in promise) RequestError: The body option must be a stream.Readable, string or Buffer on every request with your lib and I don't understand why ^^'

I'm testing with your example code :

const client = new QBittorrent({
  baseUrl: 'http://localhost:8080/',
  username: 'admin',
  password: 'adminadmin',
});

async function main() {
  const res = await qbittorrent.getAllData();
  console.log(res);
}

Have nice day

Make _normalizeTorrentData public or include raw torrent data in normalized object

I'd like to primarily work with the normalized data but need some client-specific fields as well, one example is tags.
With current design I'd have to fetch the same data twice which seem unneccecary.

It would be nice if either _normalizeTorrentData was public so that I could use it myself after fetching with listTorrents or that NormalizedTorrent included a raw: Record<string, any> property (or similar)

removeTorrent is not normalized

According to the docs the remove torrent function should be normalized between:

qbittorrent
deluge
transmission
utorrent
rtorrent

However, removeTorrent here returns a boolean
On Transmission it returns AddTorrentResponse
Deluge returns BooleanStatus
and uTorrent returns BaseResponse

Shouldn't this return a normalised result?

Add torrent via Magnet

I am using this library in conjunction with an RSS parser, as many RSS feeds, use magnets instead of links to torrent files, I require this functionality, after searching the codebase, the only reference I found is the "magnet_uri" property of the torrent interface, is there an easy way to implement this, I don't mind digging around and submitting a pr.

add torrent via url?

Is it possible to add a new torrent via torrent url, instead of local file path?

If so, I couldn't find it in the docs.

Problem importing from `types`

My app's throwing a not found error in development with the following statement (but build succeeds)

import { TorrentState } from "@ctrl/qbittorrent/dist/types";

May I suggest using the exports tag of package.json in favor of the obsolete main tag which should fix this.
Some reading:
https://dev.to/binjospookie/exports-in-package-json-1fl2
https://nodejs.org/api/packages.html
https://medium.com/swlh/npm-new-package-json-exports-field-1a7d1f489ccf

Whilst we're at it, why not switch the package to an ESModule? do you have any need to use commonjs, if not I'd be happy to commit the required changes.

Regards.

Long-lived clients do not handle session cookie expiration

QBittorrent seems to have a default timeout of 3600 seconds (1 hour) for sessions when logging into the webui.

Based on the code, it does an initial login and for each request done with the same client instance, if there is a cookie set locally this._sid it sets it as the Cookie header. However after the cookie expires, it doesn't re-login, it just keeps using the same expired cookie.

Potential solution for this is to make note of the expiration of the cookie itself and re-login when needed?

split up methods from index.ts

As the number of methods supported by this repo grows (nearly 800 lines) it becomes increasingly unmaintainable, I suggest that index.ts gets turned into a module loader and exporter of sorts and split all methods into there respective files under /src/methods @scttcper what are your thoughts on this, mainly how you think such a module loader should be implmented?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.