easlice / bandcamp-downloader

Download your bandcamp collection using this python script.
MIT License
281 stars 34 forks source link

Notes on running bandcamp-downloader on windows #21

Open dfgshdsfh opened 10 months ago

dfgshdsfh commented 10 months ago

I ran into some trouble getting this to work on windows. This is my attempt to help anyone else that may also run into issues that won't be obvious with the current Usage recommendations.

This was ultimately the command line I used.

python N:\media\music\bandcamp-downloader\bandcamp-downloader.py --cookies N:\media\music\bandcamp-downloader\bandcamp-cookies.txt --directory N:\media\music\Bandcamp --filename-format "{artist}\{artist} - {title}" --format flac my_username

Here's how to get past pain points

I downloaded the zip [https://github.com/easlice/bandcamp-downloader/archive/refs/heads/master.zip] extracted to it a folder and ran pip install . as the setup suggests. A nice trick is you can use explorer to navigate to a directory, then in the address bar type "cmd". This will launch a command prompt already pointed to that directory so no cd and copy+paste needed.

Frankly the browser_cookie3 thing looks like a pain to deal with. I just used this firefox extension to generate a cookie file, which I also already use with yt-dlp: https://github.com/hrdl-github/cookies-txt I simply open bandcamp, login, and then click the extension, selecting "current site". Renamed it from cookies.txt to bandcamp-cookies.txt, and dropped it in my bandcamp-downloader folder.

Adding python to the beginning of the command was needed for my system. Who knows why.

One thing windows users should take note, is that all forward slashes / (as used in unix based systems) need to be replaced with backslashes \. This also means changing the filename format from '{artist}/{artist} - {title}' to "{artist}{artist} - {title}". If you don't change to a backslash, then bandcamp-downloader becomes confused and won't download things into separate folders, it will instead just add what was supposed to be the folder name to the front of the file "YOB-YOB - The Unreal Never Lived.zip"

Notice I also replaced the single quotes with double quotes, as single didn't seem to work. If I don't I get bandcamp-downloader.py: error: unrecognized arguments: {title}' my_username which I presume means cmd.exe doesn't understand single quotes.

Thank you easlice so much for making and maintaining this tool. I'm able to quickly and easily archive my now 211 albums, as well as see what's no longer downloadable from my last archive session (the Francis Bebey Albums seem to have been messed with for some reason). That's the biggest downside of bandcamp I've learned, items paid for can just disappear for any reason, no explanation, and no accountability.

easlice commented 10 months ago

Thanks for the report, info like this is really appreciated! Especially on systems like Windows where I don't really run things and so have less familiarity with.

I can probably fix some of this, particularly the forward and backslashes. The quote thing is odd to me, but I can look into that too.

And yeah, honestly, I'm not super happy with browser_cookie3, as it seems to break a lot and be a but tough to use, but I'm also not sure what a better option is, ultimately, for a general audience. It's one of those things where I wish bandcamp just had an API or something and you could get an access token or something like that.

Thanks for the info about generating a cookie, I might add a link to this issue in the README about it.

easlice commented 10 months ago

Ok, I pushed a change that should fix the issue with the default filename format causing issues on Windows.

FluffyJenkins commented 8 months ago

Thanks for the info about generating a cookie, I might add a link to this issue in the README about it.

Please do! :D This is allowing me to use it on WSL2, but an additional note/reminder saying the cookies need to be in the Netscape HTTP Cookie file format would also be great if you could

Thanks to you both! 💜

vin-cf commented 3 months ago

FWIW, setup on Windows went flawlessly for me, Powershell, no WSL, Python 3.11.9, using pip install, Windows 11