~/Music $ soundscrape https://soundcloud.com/grrrreatdane/roll-in-peace-bootleg
Downloading: roll in peace (bootleg)
Problem downloading roll in peace (bootleg)
Traceback (most recent call last):
File "/Users/rjones/anaconda/lib/python3.6/site-packages/soundscrape/soundscrape.py", line 437, in download_tracks
stream = client.get(track['stream_url'], allow_redirects=False, limit=200)
File "/Users/rjones/anaconda/lib/python3.6/site-packages/soundcloud/client.py", line 133, in _request
return wrapped_resource(make_request(method, url, kwargs))
File "/Users/rjones/anaconda/lib/python3.6/site-packages/soundcloud/request.py", line 148, in make_request
result.raise_for_status()
File "/Users/rjones/anaconda/lib/python3.6/site-packages/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 429 Client Error: Unknown for url: https://api.soundcloud.com/tracks/377559152/stream?limit=200&client_id=175c043157ffae2c6d5fed16c3d95a4c
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/rjones/anaconda/bin/soundscrape", line 11, in <module>
sys.exit(main())
File "/Users/rjones/anaconda/lib/python3.6/site-packages/soundscrape/soundscrape.py", line 119, in main
process_soundcloud(vargs)
File "/Users/rjones/anaconda/lib/python3.6/site-packages/soundscrape/soundscrape.py", line 292, in process_soundcloud
id3_extras=id3_extras)
File "/Users/rjones/anaconda/lib/python3.6/site-packages/soundscrape/soundscrape.py", line 460, in download_tracks
puts_safe(e)
File "/Users/rjones/anaconda/lib/python3.6/site-packages/soundscrape/soundscrape.py", line 1315, in puts_safe
puts(text)
File "/Users/rjones/anaconda/lib/python3.6/site-packages/clint/textui/core.py", line 57, in puts
s = tsplit(s, NEWLINES)
File "/Users/rjones/anaconda/lib/python3.6/site-packages/clint/utils.py", line 69, in tsplit
string = string.replace(i, final_delimiter)
AttributeError: 'HTTPError' object has no attribute 'replace'
Hey there.
Issues #206 & #204 are related.
I think Sounscrape cannot keep going with this client_id & secret key or even with many of them as it will always reach Soundcloud API limits at some point.
As Soundcloud closed new app registering I think it would be better to just ask the user to login and then scrap the DOM (with Selenium + Chrome/Firefox in --headless) to get the token and then download the tracks. If you go to urls like:
You then get a response like:
You can then simply download with “http_mp3_128_url”.
The idea would be :
What do you think ?
I can do it if you like but as I don’t know Sounscrape lib I’ve no idea how much refactoring I would have to do to make that fit.