iheanyi / bandcamp-dl

Simple python script to download Bandcamp albums
The Unlicense
948 stars 108 forks source link

Trying to download discography, getting: AttributeError: 'NoneType' object has no attribute 'string' #231

Closed curtissimo41 closed 3 days ago

curtissimo41 commented 1 month ago

Bug Description When trying to download a discography, bandcamp-dl is returning the error message: "AttributeError: 'NoneType' object has no attribute 'string'".

To Reproduce Command to reproduce the behavior: bandcamp-dl https://<artist>.bandcamp.com/

Expected behavior Attempting to run the command will return the AttributeError message.

Logs

Traceback (most recent call last):
  File "/home/curtis/.local/bin/bandcamp-dl", line 8, in <module>
    sys.exit(main())
  File "/home/curtis/.local/lib/python3.10/site-packages/bandcamp_dl/__main__.py", line 98, in main
    album_list.append(bandcamp.parse(url, not arguments['--no-art'], arguments['--embed-lyrics'],
  File "/home/curtis/.local/lib/python3.10/site-packages/bandcamp_dl/bandcamp.py", line 42, in parse
    bandcamp_json = BandcampJSON(self.soup, debugging).generate()
  File "/home/curtis/.local/lib/python3.10/site-packages/bandcamp_dl/bandcampjson.py", line 17, in generate
    self.get_js()
  File "/home/curtis/.local/lib/python3.10/site-packages/bandcamp_dl/bandcampjson.py", line 28, in get_js
    embedded_scripts_raw = [self.body.find("script", {"type": "application/ld+json"}).string]
AttributeError: 'NoneType' object has no attribute 'string'

Desktop:

kjake commented 2 weeks ago

This is fixed in my PR: https://github.com/iheanyi/bandcamp-dl/pull/234 Command line is: bandcamp-dl --artist [subdomain] music Otherwise, the command will fail because no "URL" is parsed.

kjake commented 3 days ago

The PR has merged, so I think this can be closed @Evolution0