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:
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:
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:
Thanks.