Miserlou / Miserlou/SoundScrape
soundcloud soundscrape no longer working (401 unauthorized)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 143
- PR merge metrics
- No merged PRs in 30d
Description
Hey, it seems to me like soundscraping soundcloud is no longer working. Following the issue throughout the code its seems that a 401 http error, unauthorized is the issue, which is the response received in line 526 [get_hard_track_url()].
Does this have something todo with the new security update from soundcloud? https://developers.soundcloud.com/blog/security-updates-api
would be super happy if a fix for this issue was found.
best wishes,
simon
macbook:3.6 simon$ soundscrape https://soundcloud.com/afterhour-sounds/premiere-ele-bisu-app_version=1481046241
Scraping: Stream PREMIERE: ele & bisu - Cardamom Coffee [ Talpa Rec. ]
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/soundscrape/soundscrape.py", line 188, in process_soundcloud
resolved = client.get('/resolve', url=artist_url, limit=200)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/soundcloud/client.py", line 133, in _request
return wrapped_resource(make_request(method, url, kwargs))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/soundcloud/request.py", line 148, in make_request
result.raise_for_status()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.soundcloud.com/tracks/1021056175
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/soundscrape", line 8, in <module>
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/soundscrape/soundscrape.py", line 123, in main
process_soundcloud(vargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/soundscrape/soundscrape.py", line 222, in process_soundcloud
filename = download_file(hard_track_url, filename)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/soundscrape/soundscrape.py", line 1227, in download_file
if url[0:2] == '//':
TypeError: 'NoneType' object is not subscriptable
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in soundscrape.py at get_hard_track_url() around line 526 and follow the process_soundcloud() traceback through the SoundCloud client request. Read the linked SoundCloud security update to understand the 401 response. Done means SoundCloud tracks resolve successfully and the failure no longer reaches download_file() as a None URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100