iheanyi / bandcamp-dl

Simple python script to download Bandcamp albums
The Unlicense
941 stars 104 forks source link

AttributeError: 'NoneType' object has no attribute 'string' #176

Closed 97997 closed 3 years ago

97997 commented 3 years ago

**Python version: 3.8.4

**Bandcamp-dl version: 0.0.9.post1

**Bancamp-dl options: bandcamp-dl URL

**url: https://obozdur.bandcamp.com/album/silver-cross-clone

**Describe the issue: AttributeError: 'NoneType' object has no attribute 'string'

Traceback (most recent call last): File "C:\Python38\Scripts\bandcamp-dl-script.py", line 11, in load_entry_point('bandcamp-downloader==0.0.9.post1', 'console_scripts', 'bandcamp-dl')() File "C:\Python38\lib\site-packages\bandcamp_dl__main__.py", line 93, in main album = bandcamp.parse(url, True, arguments['--embed-lyrics'], arguments['--debug']) File "C:\Python38\lib\site-packages\bandcamp_dl\bandcamp.py", line 40, in parse bandcamp_json = BandcampJSON(self.soup, debugging).generate() File "C:\Python38\lib\site-packages\bandcamp_dl\bandcampjson.py", line 18, in generate self.get_js() File "C:\Python38\lib\site-packages\bandcamp_dl\bandcampjson.py", line 29, in get_js embedded_scripts_raw = [self.body.find("script", {"type": "application/json+ld"}).string] AttributeError: 'NoneType' object has no attribute 'string'

r3g31rk commented 3 years ago

approximately the same here

**Python version: 3.5

**Bandcamp-dl version: 0.0.8.12

**Bancamp-dl options: bandcamp-dl URL

**url: https://bangface.bandcamp.com/album/bangface-neo-rave-armageddon

**Describe the issue: AttributeError: 'NoneType' object has no attribute 'string'

Traceback (most recent call last): File "/home/switch/.local/bin/bandcamp-dl", line 10, in sys.exit(main()) File "/home/switch/.local/lib/python3.5/site-packages/bandcamp_dl/main.py", line 93, in main album = bandcamp.parse(url, True, arguments['--embed-lyrics'], arguments['--debug']) File "/home/switch/.local/lib/python3.5/site-packages/bandcamp_dl/bandcamp.py", line 40, in parse bandcamp_json = BandcampJSON(self.soup, debugging).generate() File "/home/switch/.local/lib/python3.5/site-packages/bandcamp_dl/bandcampjson.py", line 25, in generate self.js_to_json() File "/home/switch/.local/lib/python3.5/site-packages/bandcamp_dl/bandcampjson.py", line 50, in js_to_json self.get_js() File "/home/switch/.local/lib/python3.5/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'

eledah commented 3 years ago

I had the same issue when I used pypi to install it. Then I installed it from source and now it's working.

97997 commented 3 years ago

I also installed from source, and i just did it again, but still, is not working

97997 commented 3 years ago

The program is working correctly after aplying this fix (reinstalling from source)

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
r3g31rk commented 3 years ago

Indeed, it worked like a charm after installing from source. Thanks a lot @eledah and @97997 .