setvisible / ArrowDL

ArrowDL (Arrow Downloader) is a download manager for Windows, MacOS and Linux
https://www.arrow-dl.com/
GNU Lesser General Public License v3.0
613 stars 33 forks source link

Download from login-protected page (get cookies from Firefox) #25

Open jocap opened 3 years ago

jocap commented 3 years ago

One of the benefits of having the download manager integrated into Firefox is that it can access pages that are protected by a cookie-based login. This is the only case I've found where DownZemAll, as a standalone application, is limited.

Ideally, the Firefox add-on would relay relevant cookies to DownZemAll.

Judging from the documentation, it seems rather simple to access cookies from a web extension. This code should (I think) access the current tab's cookies, provided the extension has the correct permissions:

browser.cookies.getAll({url: tabs.pop().url}).then((cookies) => {
    for (let cookie of cookies) {
        // cookie.name
        // cookie.value
    }
})

Then it's a matter of sending that to DownZemAll and having DownZemAll make the request using the cookies.

setvisible commented 3 years ago

Hi, Looks like a challenging feature to implement!