的SoundCloud,通过API下载或流文件 [英] SoundCloud, download or stream file via api

查看:131
本文介绍了的SoundCloud,通过API下载或流文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用DOWNLOAD_URL来从SoundCloud获取文件。<​​/ P>

我要么得到重定向或401未授权',我怎么能下载/流式传输到客户端?

感谢


解决方案

如果你得到一个401响应,那么你应该包括你的的client_id 请求。这也可能是因为这是一个私人的声音,在这种情况下,你也不得不包括OAuth认证。

实际的成功响应是重定向,因为流文件是从不同的服务器进行访问,但只能用特殊的时间限制的访问令牌(包含在重定向响应)。基本上,只要按照重定向,你就会有你的数据流。

I try to use download_url to get file from soundcloud.

I either get 'redirected' or '401 unauthorized', how can I download/stream it to client side?

thanks

解决方案

If you are getting a 401 response, then you should include your client_id in the request. It might also be that it's a private sound, in which case, you'd also have to include the oauth credentials.

The actual success response is a redirect, since the stream files are accessible from a different server, but only with special time-limited access tokens (included in the redirect response). Basically, just follow the redirect and you'll have your stream.

这篇关于的SoundCloud,通过API下载或流文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆