BandcampEnhancementSuite
BandcampEnhancementSuite copied to clipboard
Batch Download
The current state allows users to download a .txt
file which provides cURL
commands to download their purchases.
However, it is possible to download the files via JS and server them after they have downloaded.
This would be a far easier and user friendly experience.
looks like client-zip might be the solution: https://stackoverflow.com/questions/8608724/how-to-zip-files-using-javascript
this solution should work BUT it will require a backend service (similar to waveform_backend
) because of the CORS policy. Basically, the urls come from thet4.bcbits.com
domain.
This shouldn't be too difficult to build. Likely, each URL should be sent off in sequence, and then the file response returned to the frontend where it will get packaged into the zip.
alternatively it may be possible to just have all the URLs downloaded in the backend but it is unclear if the final zip download can be initiated from the backed. If they have to be passed to the frontend, doing them in a giant batch will likely result in too much memory usage.
sequential will be slower for sure. but the added benefit is the ability to update a progress bar on the frontpage to inform the user that the download is working.
development has begun on: https://github.com/sabjorn/BandcampEnhancementSuite/tree/feat/69_zip_batch_download
it may be best to have the download action happen on the download link page automatically. As downloads become available on the page (they happen in a sequence over time) the action could add it to a backend download queue. This would also allow for a downloading icon/progress bar for each track as they download. Then finally a zip download with everything becomes available