rhadamanthe / host-grabber-pp

A web extension, originally designed for Firefox, to find and download media files from various hosts.
MIT License
16 stars 6 forks source link

Too many downloads at once #9

Closed rhadamanthe closed 6 years ago

rhadamanthe commented 6 years ago

Currently, the extension may start hundreds of downloads at once. In fact, Firefox limits the effective ones to 6 at the same times. This is a side effect which makes it work.

In fact, the extension uses the donwload API. When one starts a download, a promise is returned. But the promise's success is not related to the completion of the download, but to the fact is started correctly. This is why we can start hundreds of downloads at once.

However, like explained, Firefox limits the number of connections to a same server. By default, we can have at most 6 active connections to a same server. See https://support.mozilla.org/fr/questions/992338

To start exploring a link after the downloads completed, we should rather use downloads.onChanged. Not sure this is really necessary for the moment.

rhadamanthe commented 6 years ago

In fact, there should be a preference to specify the maximum number of download this extension can start.