当前浏览的是 v7 预览版文档(v7 尚未正式发布,API 可能随版本调整)。本页是 v7 新增内容,去 v6 正式版文档首页
@ikenxuan/amagi

视频下载流信息

取稿件的播放与下载流地址;高清档位需要带登录凭证,`cid` 来自 `videoInfo`。

GET
/api/bilibili/fetch_video_playurl

Authorization

bearerAuth
AuthorizationBearer <token>

仅在 startServer 传了 token 时生效

In: header

Query Parameters

avid*integer

稿件 AV 号,纯数字不带 av 前缀

Range1 <= value <= 9007199254740991
cid*integer

稿件 cid(分 P 的视频流 ID)

Range1 <= value <= 9007199254740991

Response Body

application/json

application/json

curl -X GET "https://example.com/api/bilibili/fetch_video_playurl?avid=1&cid=1"
{  "success": true,  "data": {    "code": 0,    "data": {      "accept_description": [        "string"      ],      "accept_format": "string",      "accept_quality": [        0      ],      "auto_qn_resp": {        "dyeid": "string",        "qn_feature": {          "quality_tag": "string",          "sub_tid_name": "string",          "tid_name": "string"        }      },      "cur_language": "string",      "cur_production_type": 0,      "dash": {        "audio": [          {            "SegmentBase": {              "Initialization": "string",              "indexRange": "string"            },            "backupUrl": [              "string"            ],            "backup_url": [              "string"            ],            "bandwidth": 0,            "baseUrl": "string",            "base_url": "string",            "codecid": 0,            "codecs": "string",            "frameRate": "string",            "frame_rate": "string",            "height": 0,            "id": 0,            "mimeType": "string",            "mime_type": "string",            "sar": "string",            "segment_base": {              "index_range": "string",              "initialization": "string"            },            "startWithSap": 0,            "start_with_sap": 0,            "width": 0          }        ],        "dolby": {          "audio": null,          "type": 0        },        "duration": 0,        "flac": null,        "minBufferTime": 0,        "min_buffer_time": 0,        "video": [          {            "SegmentBase": {              "Initialization": "string",              "indexRange": "string"            },            "backupUrl": [              "string"            ],            "backup_url": [              "string"            ],            "bandwidth": 0,            "baseUrl": "string",            "base_url": "string",            "codecid": 0,            "codecs": "string",            "frameRate": "string",            "frame_rate": "string",            "height": 0,            "id": 0,            "mimeType": "string",            "mime_type": "string",            "sar": "string",            "segment_base": {              "index_range": "string",              "initialization": "string"            },            "startWithSap": 0,            "start_with_sap": 0,            "width": 0          }        ]      },      "format": "string",      "from": "string",      "high_format": null,      "last_play_cid": 0,      "last_play_time": 0,      "message": "string",      "play_conf": {        "is_new_description": true      },      "quality": 0,      "result": "string",      "seek_param": "string",      "seek_type": "string",      "support_formats": [        {          "can_watch_qn_reason": 0,          "codecs": [            "string"          ],          "display_desc": "string",          "format": "string",          "limit_watch_reason": 0,          "new_description": "string",          "quality": 0,          "report": {},          "superscript": "string"        }      ],      "timelength": 0,      "video_codecid": 0,      "view_info": null    },    "message": "string",    "ttl": 0  },  "error": {    "kind": "validation",    "code": "string",    "message": "string",    "retryable": true,    "platform": {      "code": "string",      "message": "string"    },    "http": {      "status": 0,      "statusText": "string"    },    "issues": [      {        "path": "string",        "message": "string",        "received": null      }    ]  },  "message": "string",  "meta": {    "requestId": "string",    "clientId": "string",    "platform": "douyin",    "endpoint": "string",    "durationMs": 0,    "attempts": 0,    "trace": [      {        "url": "string",        "method": "string",        "status": 0,        "durationMs": 0,        "reason": "initial",        "retryOf": "string"      }    ]  },  "requestPath": "/api/bilibili/fetch_one_video?bvid=BV1xx"}