Code Monkey home page Code Monkey logo

Comments (8)

Chaphasilor avatar Chaphasilor commented on May 29, 2024 2

Okay, just tested it, but it seems like the throttling is not working at all, sadly. I can see the set bandwidth reflected in the progress bar in the command line, and it does seem to change when updating xdccJS.irc.throttle, but the actual download speed it not affected at all. Not even when providing the throttle option directly to the constructor and not modifying afterwards.

The file size increases much faster than the set throttle, and the download progress does not align with the progress shown in the command line. I tested it by downloading a video and checking how far ahead I could skip in the downloaded video already :(

from xdccjs.

Chaphasilor avatar Chaphasilor commented on May 29, 2024 1

Hey, thanks for the super quick release! I'm currently checking it out, and I'm wondering if I can simply update xdccJS.irc.throttle with a new value to change the throttle on-the-fly, or if this won't work as expected?

from xdccjs.

JiPaix avatar JiPaix commented on May 29, 2024

Hey, thanks for the super quick release! I'm currently checking it out, and I'm wondering if I can simply update xdccJS.irc.throttle with a new value to change the throttle on-the-fly, or if this won't work as expected?

I didn't test this, but in theory yes, the new value should be applied even mid-download

from xdccjs.

JiPaix avatar JiPaix commented on May 29, 2024

I had a misconception on how to do this.

The solution i found can't (unless i spend countless hours i don't have) change the bandwidth limit until the next download is fired.

from xdccjs.

Chaphasilor avatar Chaphasilor commented on May 29, 2024

I guess that's fine. Restarting XDCC downloads isn't always a good idea (due to rate limiting, etc.), but maybe I can add some wrapping code that cancels an active download and re-queues it at a later time...

The download limit is still global and not per-job, right? But I should be able to set a global limit, start a download, and then reset the global limit, right?

I'll check it out in the coming days, currently don't have access to a PC...

from xdccjs.

JiPaix avatar JiPaix commented on May 29, 2024

The download limit is still global and not per-job, right? But I should be able to set a global limit, start a download, and then reset the global limit, right?

see v5.1.2

xdccJS/CHANGELOG.md

Lines 1 to 15 in 7982f88

# Changelog
## [v5.1.2](https://github.com/jipaix/xdccjs/tree/v5.1.2)
### BREAKING CHANGES
* `xdcc.download`'s ipv6 parameter must be passed through an object: `xdcc.download('bot', 1, { ipv6: true })`
### feat(lib)
* add per download throttle: `xdcc.download('bot', 1, { throttle: 1000 })`
* download's throttle can be applied on top of global throttle
```js
xdccJS.config({ throttle: 5000 })
await xdccJS.download('BOT-A', 1, { throttle: 500 })
await xdccJS.download('BOT-A', 2, { throttle: 1000 })
await xdccJS.download('BOT-B', 1)
// BOT-A packet 1 and 2 is throttled at 1000 (latest value)
// BOT-B throttled at 5000
```

from xdccjs.

Chaphasilor avatar Chaphasilor commented on May 29, 2024

okay, gave it another spin. it's working much better now, and the per-download throttling is nice. there are only a few minor issues for me:

  • there seems to be no way to read out the current config? I was trying to implement the status page, that shows the currently configured throttle, but I found no way to access it on the xdccJS object

  • the throttle value is actually in B/s, not kB/s (as it should be). This should be reflected in the documentation, as well as in the console output that is printed after calling config():

    throttling at 2 GiB/s

    is actually 2 MiB/s

  • the options for the download() method seem to be lacking some types, the method throws and error if throttle is not a number or undefined can't reproduce this anymore

I'll try to leave this running for a bit and report any issues :)

from xdccjs.

JiPaix avatar JiPaix commented on May 29, 2024

update to 5.1.5 should fix all that

here seems to be no way to read out the current config? I was trying to implement the status page, that shows the currently configured throttle, but I found no way to access it on the xdccJS object

// define global throttle
xdccJS.config({ throttle: 5000 })
// start job with specific throttle value
const job = await xdccJS.download('bot', [1-5], { throttle: 1000 })

console.log(xdccJS.config().throttle) //=> 5000
console.log(job.show().throttle) //=> 1000

the throttle value is actually in B/s, not kB/s (as it should be). This should be reflected in the documentation, as well as in the console output that is printed after calling config():

Fixed

from xdccjs.

Related Issues (20)

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.