0

I am trying to scrape new music form sound loud and upload them via telegram group so, I asked here and by not finding answer I have tried to use another Python SoundCloud scraper module by below commands, which could run on this Colab page, too:

enter image description here

pip install soundcloud-lib

from sclib import SoundcloudAPI, Track, Playlist

api = SoundcloudAPI()
playlist = api.resolve('https://soundcloud.com/razhavaniazha-com')

assert type(playlist) is Playlist

for track in playlist.tracks:
    filename = f'./{track.artist} - {track.title}.mp3'
    with open(filename, 'wb+') as fp:
        track.write_mp3_to(fp)

but by running the above codes, get this error:

HTTPError                                 Traceback (most recent call last)
<ipython-input-6-023e08e56a22> in <module>()
      2 
      3 api = SoundcloudAPI()
----> 4 playlist = api.resolve('https://soundcloud.com/razhavaniazha-com')
      5 
      6 assert type(playlist) is Playlist

9 frames
/usr/lib/python3.7/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
    647 class HTTPDefaultErrorHandler(BaseHandler):
    648     def http_error_default(self, req, fp, code, msg, hdrs):
--> 649         raise HTTPError(req.full_url, code, msg, hdrs, fp)
    650 
    651 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 403: Forbidden

I have tried this code on my pc and I get the same error, I guess the SoundCloud require a client ID for doing the music scraping. But the SoundCloud don't give the client ID by using this video instruction and give the below message:

enter image description here

SoundCloud Application Registration Due to the high amount of requests recently received, we will no longer be processing API application requests at this time. We are working to re-evaluate our process to make it more efficient.

So, I asked here to understand how to do it without the client ID?

Also asked here:

https://github.com/3jackdaws/soundcloud-lib/issues/29

update:

It is strange which it is done by python youtube-dl module as you can see via this post and cloud test it via the below colab page: enter image description here

Thanks.

Soheil Paper
  • 1
  • 2
  • 8
  • 25
  • Sorry, are you trying to scrape the data from the SoundCloud interface (as your gratuitous use of the word “scrape” would suggest) or are you trying to retrieve this information via an API (as your code would lead one to believe)? It’s not clear what you’re attempting, or even how you believe you would be able to successfully authorize against a service without valid credentials. Trying to leverage an API without the requisite token/authentication information is like asking “How can I access my information in my Google account without using my username or password?” - it simply isn’t an option – esqew Jul 13 '21 at 19:47
  • Yes, I have tried to scrap data form SoundCloud, but guess sound cloud has restricted the access for new apps and I have found my client ID by [this post](https://stackoverflow.com/questions/40992480/getting-a-soundcloud-api-client-id) instruction. But is asked here, and I guess it is not working. – Soheil Paper Jul 13 '21 at 19:55

0 Answers0