How to batch download all files in a Volafile.io room? Volafile.io Live Filesharing &amp; Chat


Example URL: https://volafile.io/r/$ID. 

There is Feature request: Download all the content of a room in a .zip file. #117. I don't wish to depend on that feature request.

How to download all files in a Volafile.io room? I prefer a command line solution (Open Source, installable by homebrew), something like what's youtube-dl for YouTube.

Jdwonloader at the moment doesn't support Volafile.io. If there is no CLI solution, how to do that with GUI?
You can paste this JavaScript in Chrome’s developer console:

// Get all download links
var fileArray = document.getElementsByClassName('file_left_part')
// Loop through all the file links and append a new link to the DOM
// with a download attribute
for (var i = 0; i &lt; fileArray.length; i++) {
    var dlLink = document.createElement('a')
    dlLink.download = ''
    dlLink.href = fileArray[i].href
    dlLink.className = 'filetype_download'
    document.body.appendChild(dlLink)
}
// Select all the download links we just created
var dlLinkArray = document.getElementsByClassName('filetype_download')
// Create a function to click on each link in series with a delay
// of 2.5 seconds (volafile will rate limit you otherwise)
function clickIt(i) {
    setTimeout(function() { dlLinkArray[i].click() }, i * 2500)
}
// Run our click function on every download link
for (var i = 0; i &lt; dlLinkArray.length; i++) {
    clickIt(i)
}