Open wesleymartin234 opened 4 years ago
Additional Info:
`Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/simplejson/scanner.py", line 37, in _scan_once nextchar = string[idx] IndexError: string index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/soundscrape/soundscrape.py", line 174, in process_soundcloud resolved2 = requests.get(next_href).json() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests/models.py", line 898, in json return complexjson.loads(self.text, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/simplejson/init.py", line 525, in loads return _default_decoder.decode(s) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/simplejson/decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/simplejson/decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/simplejson/scanner.py", line 79, in scan_once return _scan_once(string, idx) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/simplejson/scanner.py", line 39, in _scan_once raise JSONDecodeError(errmsg, string, idx) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/simplejson/scanner.py", line 37, in _scan_once nextchar = string[idx] IndexError: string index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/soundscrape", line 33, in
looks like same issue as https://github.com/Miserlou/SoundScrape/issues/253
Seems like this happens:
use requests to get the user id of the user you want likes for:
userId = str(client.get('/resolve', url=artist_url).id)
use soundclound client to get a page of the user's favorites
resolved = client.get('/users/' + userId + '/favorites', limit=200, linked_partitioning=1)
if there is a next_href
to indicate there is a next page (there is in this case), get info on that page as json.
resolved2 = requests.get(next_href).json()
^ this actually fails with : 401: {'code': 401, 'message': '', 'link': 'https://developers.soundcloud.com/docs/api/explorer/open-api', 'status': '401 - Unauthorized', 'errors': [], 'error': None}
then we try to access "collection" on that dict which does not exist
so 2 things i see wrong with this, 1) so it seems pagination is not correctly implemented as requests does not have the permission that the soundcloud client has 2) '/users/' + userId + '/favorites', is deprecated, (use /users/:userId/likes/tracks instead, to fetch a user's likes)
@Miserlou potential fix: https://github.com/Miserlou/SoundScrape/pull/254
@wesleymartin234 here I've updated my pr, this should work #254, but that user has 2029 likes are you sure you want to download all that?
soundscrape idkidc1 -l
results in:
Expecting value: line 1 column 1 (char 0) Process finished with exit code 0
I've also attempted using --likes
Note:
I am able to successfully get basic track downloads from this artist.
I am able to successfully get likes from other artists.
This artist has a high number of likes.
Could this be a problem with failure to return JSON payload from the likes page ?
How to debug?
Any response or assistance is appreciated.