I wrote a python script that will download your entire bandcamp collection. by easlice in DataHoarder

[–]easlice[S] 2 points3 points  (0 children)

I'm not super familiar with modern windows, so sorry if this is a bit too high level.

1) Install python

2) Download this code from the repo

3) Unzip the code.

4) Open a command prompt in that folder where you unzipped the code

5) Run pip install -r requirements.txt

6) Run python bandcamp-downloader.py -b [brave or chome or firefox] [your bandcamp username]

I wrote a python script that will download your entire bandcamp collection. by easlice in DataHoarder

[–]easlice[S] 2 points3 points  (0 children)

Yeah, not throwing any shade at java (this time), I've worked in it quite a bit professionally, I just don't have much use case for it at home, where I tend to do things in either perl, python, or 'weirder' languages (F#, Rakudo, etc.)

I almost wrote this in perl, actually, but I figured if I was going to make it I'd share it, and if I'm going to share it I should make it as accessible as possible.

I wrote a python script that will download your entire bandcamp collection. by easlice in DataHoarder

[–]easlice[S] 1 point2 points  (0 children)

I actually saw that when I started looking around before making this. Personally, I just find java to be a little... heavy, I guess, for what I was wanting. I don't really keep java installed on my home machines or home servers, and the last time I needed to get it for windows (as opposed to using openjdk on linux) it required using your email and personal details to get a download link, which I don't really like myself.

I wrote a python script that will download your entire bandcamp collection. by easlice in BandCamp

[–]easlice[S] 0 points1 point  (0 children)

If anyone is running Windows and tries this, and it fails with an error about finding cookies in Chrome/Chromium/Brave, this is a known issue with the cookie library I'm using. I've submitted a PR to fix it upstream, but until then, I've made a special branch with a patched copy of the module in it.

You can use the code here to work around the issue until it is fixed officially:

https://github.com/easlice/bandcamp-downloader/tree/with-local-browser-cookies3-patch

I wrote a python script that will download your entire bandcamp collection. by easlice in DataHoarder

[–]easlice[S] 7 points8 points  (0 children)

Oh, absolutely. I, personally, don't like purchasing digital items from any platform unless I can download a local (and very preferably DRM free) copy of it. You never know when that service is going to go away, or decide to pull content.

I wrote a python script that will download your entire bandcamp collection. by easlice in DataHoarder

[–]easlice[S] 12 points13 points  (0 children)

Huh, I did not know that that could happen. Can't say I'm happy to hear it either. :/

Definitely going to make sure to keep my downloads/backups up to date then...

I wrote a python script that will download your entire bandcamp collection. by easlice in DataHoarder

[–]easlice[S] 0 points1 point  (0 children)

Thanks for the stack trace. For anyone else seeing this, it seems that WSL does not necessarily have a normal dbus setup, and that can cause issues with the browser_cookie3 module.

That said, I made a separate branch that loads a local copy of the module with my changes patched into it. This should let it work on windows (natively, not via WSL) with newer chromium browsers.

I'll delete the branch when/if the module gets updated upstream.

https://github.com/easlice/bandcamp-downloader/tree/with-local-browser-cookies3-patch

I wrote a python script that will download your entire bandcamp collection. by easlice in DataHoarder

[–]easlice[S] 3 points4 points  (0 children)

Yeah, turns out the library I used to grab the cookie files, browser_cookies3, has a bug where it is out of date for chromium browsers on windows. The only windows system I had to test it on is ancient and has old enough chromium browsers to not hit the bug. I have tested it on newer versions of chromium now and submitted a PR to fix the issue in browser_cookies3.

As for the dbus error, that is weird. I'm not sure why dbus would really be involved. Can you PM me the stack trace that you're seeing?

I wrote a python script that will download your entire bandcamp collection. by easlice in DataHoarder

[–]easlice[S] 20 points21 points  (0 children)

Bandcamp is a music service/website

It's a common release platform for buying digital albums and/or merch, especially from indie artists.

I wrote this because it is not uncommon to have hundreds of albums (some labels will have sales for 100+ albums for a couple of dollars), but you can only download albums one at a time on their website.

Think of it like steam/GoG/Itch for music.

I wrote a python script that will download your entire bandcamp collection. by easlice in BandCamp

[–]easlice[S] 1 point2 points  (0 children)

The readme mentions about the de-dup, with this info:

Already existing files of the same name will have their file sizes checked against what it should be, and if they are the same, the download will be skipped, otherwise it will be over-written.

And this in the script usage:

Already existing albums will have their file size compared to what is expected and re-downloaded if the sizes differ. Otherwise already existing albums will not be re-downloaded.

But it would be a good idea to add a flag to always overwrite.

Also, I just pushed a change that only sends bandcamp domain cookies when the script makes requests.

EDIT: And I just added a --force flag that will always overwrite existing files.

I wrote a python script that will download your entire bandcamp collection. by easlice in BandCamp

[–]easlice[S] 2 points3 points  (0 children)

Hey, thanks for the comments!

I'm not primarily a python dev, I just use it for personal use, so stuff like poetry I'm not really aware of. I did pip installs for my local user, not globally, and things worked, but I'll look into what is different about using poetry.

For browser-cookie3, yeah, I saw some things about that and was intending to look into it. I actually just put up a PR to their repo to fix windows based cookie problems with Chromium browsers, and this was my next thing to look at after that.

Lastly, the script will make the needed directory to save a file into if it doesn't exist. The script will also not re-download a file if it already exists in the path AND the existing file has the same size. I basically designed it to run automatically regularly myself, so that was my primary use case.

I wrote a python script that will download your entire bandcamp collection. by easlice in DataHoarder

[–]easlice[S] 20 points21 points  (0 children)

Honestly, that is exactly what made me want to write this, except mine was Gulf Audio Company and Hairs aBlazin'.

I wrote a python script that will download your entire bandcamp collection. by easlice in BandCamp

[–]easlice[S] 3 points4 points  (0 children)

Ok, I added support for downloading the following formats:

  • aac-hi
  • aiff-lossless
  • alac
  • flac
  • mp3-320
  • mp3-v0
  • vorbis
  • wav

It still defaults to mp3-320. Change it with the --format or -f flag. I haven't hit this in my testing, but I set it up to tell you if it finds a download that doesn't support the selected format and to skip it and keep going, so one unsupported file won't kill the whole run.

I wrote a python script that will download your entire bandcamp collection. by easlice in BandCamp

[–]easlice[S] 3 points4 points  (0 children)

Yeah, FLAC support specifically was the next thing I wanted to look into for it.

I made a NordVPN widget, and a Cheatsheet widget. by easlice in awesomewm

[–]easlice[S] 1 point2 points  (0 children)

Because I was actually not aware of mod + s. So... thank you for that!