Miserlou / SoundScrape

SoundCloud (and Bandcamp and Mixcloud) downloader in Python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception : simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

AnnoyingTechnology opened this issue · comments

soundscrape low-steppa -t low-steppa-the-august-2013-mix
Traceback (most recent call last):
  File "/usr/local/bin/soundscrape", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/soundscrape/soundscrape.py", line 119, in main
    process_soundcloud(vargs)
  File "/usr/local/lib/python2.7/dist-packages/soundscrape/soundscrape.py", line 198, in process_soundcloud
    hard_track_url = get_hard_track_url(item_id)
  File "/usr/local/lib/python2.7/dist-packages/soundscrape/soundscrape.py", line 519, in get_hard_track_url
    json_response = response.json()
  File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python2.7/dist-packages/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/lib/python2.7/dist-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

this works
soundscrape lady-miss-kier -t dj-lady-miss-kier-art-basel-miami-dec-3rd
this does not work and throws the exception
soundscrape low-steppa -t low-steppa-the-august-2013-mix

uname : Linux XXXXXXX 4.19.0-2-amd64 #1 SMP Debian 4.19.16-1 (2019-01-17) x86_64 GNU/Linux
OS : Debian Buster
Pyton version : 2.7.16

Same with "soundscrape -f https://soundcloud.com/aka-aka" other like "soundscrape -f https://soundcloud.com/beatport" works

Handling http errors is improves in #241, as well as handling different types of files.