问题描述
我正在尝试抓取新音乐形式的声音并通过电报组上传它们,因此,我问了 here 并没有找到答案,我尝试使用另一个 Python SoundCloud 抓取模块通过以下命令,也可以在 this Colab page 上运行:
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)
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,hdrs):
--> 649 raise HTTPError(req.full_url,hdrs,fp)
650
651 class HTTPRedirectHandler(BaseHandler):
HTTPError: HTTP Error 403: Forbidden
我已经在我的电脑上尝试过这个代码,但我得到了同样的错误,我猜 SoundCloud 需要一个客户端 ID 来进行音乐抓取。但是 SoundCloud 没有通过使用 this video 指令给出客户端 ID 并给出以下消息:
由于请求量大,SoundCloud 应用注册 最近收到,我们将不再处理API申请 此时请求。我们正在努力重新评估我们的流程 提高效率。
所以,我问这里了解如何在没有客户端 ID 的情况下进行操作?
也在这里问:
https://github.com/3jackdaws/soundcloud-lib/issues/29
更新:
奇怪的是它是由 python youtube-dl
模块完成的,你可以通过 this post 看到它并通过 the below colab page 进行云测试:
谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)