easlice / bandcamp-downloader

Download your bandcamp collection using this python script.
MIT License
294 stars 38 forks source link

KeyError: 'collection_count' #23

Closed SatanicMechanic closed 12 months ago

SatanicMechanic commented 12 months ago
Retrieving album links from user [example]’s collection.
Traceback (most recent call last):
  File "/Users/me/Downloads/bandcamp-downloader-master/./bandcamp-downloader.py", line 348, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/me/Downloads/bandcamp-downloader-master/./bandcamp-downloader.py", line 156, in main
    links = get_download_links_for_user(args.username)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/Downloads/bandcamp-downloader-master/./bandcamp-downloader.py", line 208, in get_download_links_for_user
    'collection_count' : data['collection_count'],
                         ~~~~^^^^^^^^^^^^^^^^^^^^
KeyError: 'collection_count'

Might be some oddity on my end:

Help appreciated!

MasterRee commented 12 months ago

Thanks for making this script. I just saw your post in YCombinator about the BC ownership change and I was really hoping this would work as I have a fairly large collection. Unfortunately, I'm seeing the same issue. Here is my command and the output:

bandcamp-downloader.py --browser firefox --directory ~/Desktop/Bandcamp\ Collection -f flac "User Name"
Retrieving album links from user [User Name]'s collection.
Traceback (most recent call last):
  File "/Users/macOSuser/.local/bin/bandcamp-downloader.py", line 348, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/macOSuser/.local/bin/bandcamp-downloader.py", line 156, in main
    links = get_download_links_for_user(args.username)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/macOSuser/.local/bin/bandcamp-downloader.py", line 208, in get_download_links_for_user
    'collection_count' : data['collection_count'],
                         ~~~~^^^^^^^^^^^^^^^^^^^^

A few points to note:

easlice commented 12 months ago

Just to confirm for both of you (but especially you @MasterRee ), the username that you are putting in is the string that shows up at the end of the URL for your collection page?

For example, bandcamp.com/user_name would be user_name (the 'username' is basically used to create that URL, and putting something in other than that is often what creates this error)

SatanicMechanic commented 12 months ago

That was it! Thank you! I had been thinking of that name as a 'display name' because it is different from what I use to login.

easlice commented 12 months ago

Glad to hear that was it for you. I need to make it actually report this kind of suggestion when that error happens. I've got that in another big update I'm working on but it might be good to get it in sooner rather than later.

MasterRee commented 12 months ago

Thanks! That was it and in the actual URL there was no space in the username, so that was the reason for the error. Still mid download, but it looks to be working perfectly. I really appreciate you making this tool as it is saving me a lot of time and effort.

SatanicMechanic commented 12 months ago

Pardon the chatter but @MasterRee I'm still searching for a way to unzip these in batch - do you have any ideas?

MasterRee commented 12 months ago

I'm happy to help, but this is off topic, so I don't want to spam easlice with notices unrelated to this issue, so if this doesn't answer your question I would suggest doing a quick Google search on batch compression and decompression of ZIP files on macOS. There are many options.

Archive Utility is macOS's native tool for compression and decompression in Finder. If you select all the zip files in Finder, you can do a secondary click and select "Open" and it will decompress all of them. You can even set your preferences in Archive Utility first and it will automatically trash the ZIP files after they are decompressed.

Another option (and my personal choice) is Keka (https://www.keka.io/en/). A free tool for macOS (or very inexpensive if you get it through the Mac App Store to support the developer). It has more options than the native utility including support for 7zip. I hope that helps and sorry again easlice for the chatter.

SatanicMechanic commented 12 months ago

thanks!