bandcamp-dl: AttributeError: 'NoneType' object has no attribute 'string'

Python version: 3.8.6

Bandcamp-dl version: bandcamp_downloader-0.0.8.post12-py3-none-any.whl installed from pip3 on debian sid

Bancamp-dl options: none

url: none

options: none

Describe the issue:

$ bandcamp-dl
Traceback (most recent call last):
  File "/home/phoe/.local/bin/bandcamp-dl", line 8, in <module>
    sys.exit(main())
  File "/home/phoe/.local/lib/python3.8/site-packages/bandcamp_dl/__main__.py", line 93, in main
    album = bandcamp.parse(url, True, arguments['--embed-lyrics'], arguments['--debug'])
  File "/home/phoe/.local/lib/python3.8/site-packages/bandcamp_dl/bandcamp.py", line 40, in parse
    bandcamp_json = BandcampJSON(self.soup, debugging).generate()
  File "/home/phoe/.local/lib/python3.8/site-packages/bandcamp_dl/bandcampjson.py", line 25, in generate
    self.js_to_json()
  File "/home/phoe/.local/lib/python3.8/site-packages/bandcamp_dl/bandcampjson.py", line 50, in js_to_json
    self.get_js()
  File "/home/phoe/.local/lib/python3.8/site-packages/bandcamp_dl/bandcampjson.py", line 37, in get_js
    self.js_data = self.body.find("script", {"src": False}, text=re.compile(self.target)).string
AttributeError: 'NoneType' object has no attribute 'string'

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 15 (2 by maintainers)

Most upvoted comments

A slightly easier way to install from source is running

pip install git+https://github.com/iheanyi/bandcamp-dl --upgrade

Installed latest version from PyPI

Pip reported version as 0.0.9.post1

bandcamp-dl --version 0.0.9-01

Downloading works without errors!

I need to install git and put it in PATH, how do I do that?

https://github.com/git-guides/install-git

hi! i was getting the same error showed above, and uninstalling the old version and installing the latest version built from source (obtained via the link in the main page here in github) made things work here. i also had to point the python command to use python3 in the meanwhile, because bandcamp-dl was using the version provided by python, and in my case that was 2.7.something.

in sum:

pip3 uninstall bandcamp-downloader
cd /WhereYouExtractedTheZIP
[optional] sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
python setup.py install

Looks like pypi has the old version; the latest version built from the source is bandcamp-dl 0.0.9-01

I suggest you install it from the source if you need it to work. The version 0.0.9-01 (latest from source) works fine for me.