Files
bilibili-API-collect/music/musicStream_url.md
thefatwhale 605c701441 补全了一些值
补全了一些值
2020-07-20 01:11:04 +08:00

58 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 音频流URL
<img src="/imgs/download.svg" width="100" height="100"/>
## 获取音频流URL
> http://www.bilibili.com/audio/music-service-c/web/url
*请求方式GET*
__\*Web版无法播放付费歌曲__
**url参数**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ------- | ---- | ------ | ----- | -------------- |
|sid |num |音频auID |必要 |不需要au前缀 |
|privilege|num |一般为2| 非必要 |**作用尚不明确**|
|quality |num |一般为2| 非必要 |**作用尚不明确**|
_只测试了`quality`在\[-2,10\]范围内没法调整 音频品质_
**json回复**
根对象:
|字段|类型| 内容 | 备注 |
|----|---|-------------|-----------------------------------------|
|code|num| 返回值 | 0:成功<br>7201006:未找到或已下架 |
|msg |str|对`code`的描述|"success"<br>"收听出错,音频未找到或已下架"|
|data|obj| 数据本体 |当`code`为7201006时不存在 |
`data`对象:
|字段 |类型 |内容 |备注 |
|---------|--------|---------|--------------------------------|
|cover |nul |空 |**作用尚不明确** |
|info |str |空字符串 |**作用尚不明确** |
|qualities|nul |空 |**作用尚不明确** |
|sid |num |音频auID | |
|size |num |文件大小 |单位:字节,当`type`为-1时`size`为0|
|timeout |num |有效时长 |一般为三个小时 |
|title |nul |空 |**作用尚不明确** |
|type |num |音频版权 |1为正常<br>-1为付费 |
|cdns |array |音频url | |
`data`对象的`cdns`数组:
| 项 | 类型 | 内容 | 备注 |
|------|-----|-------------------|---------------------------------------------------------------------------------|
| 0 | str | 音频url |当`data`对象`type`为1时可以获得完整版<br>`data`对象`type`为-1时可以获得30秒试听版本|
| 1 | str | 音频url(备用) | |
**发送音频url请求时需要 `user-agent`值不为空** 否则会失败
默认为192Kbps(标准)品质