Soundcloud content retrieval without a client ID. Is it at all possible?

╄→尐↘猪︶ㄣ 提交于 2019-12-08 01:26:55

问题


Soundcloud have locked off their API and nobody is able to request a new Client ID. Before they closed it off they were simply ignoring API key requests for months. They obviously have their reasons but it's been this way for ages now and it's really annoying.

Does anybody know any cheeky workarounds to retrieve track data from a supplied username?

I've tried parsing the dom and scraping it but it doesn't work as they return "no javascript" errors when scraping which renders the homepage and not the user page.

Example :

$url = "https://soundcloud.com/username/tracks";
$dom = new Dom;
$dom->loadFromUrl($url);

$dom = $dom->find('title',0)->text;

Should return :

username | Free Listening on SoundCloud

But instead we get :

SoundCloud - Hear the world’s sounds

回答1:


My suggestion would be to use an existing public API key, for example, the CLIENT_ID youtube-dl uses to download SoundCloud tracks.

You'll first need to get the id from the username. We'll use the /resolve endpoint for this:

HTTP GET: http://api.soundcloud.com/resolve?url=http://soundcloud.com/{username}&client_id={CLIENT_ID}

Then, get the user's tracks from the /users/{id}/tracks endpoint:

HTTP GET: https://api.soundcloud.com//users/{id}/tracks


来源:https://stackoverflow.com/questions/49634738/soundcloud-content-retrieval-without-a-client-id-is-it-at-all-possible

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!