稳定、快速、免费的 API 接口服务
获取爱奇艺视频播放链接
接口地址: https://api.leafone.cn/api/iqiyi
返回格式: JSON
请求方式: GET,POST
请求示例: https://api.leafone.cn/api/iqiyi?url=https://www.iqiyi.com/v_1exqq3b7d8c.html
请求参数说明:
名称 | 必填 | 类型 | 说明 |
---|---|---|---|
url | 是 | string | 爱奇艺视频链接 |
cookie | 否 | string | 爱奇艺Cookie参数P00001的值,用于解析VIP视频 |
返回参数说明:
名称 | 类型 | 说明 |
---|---|---|
title | string | 视频标题 |
type | string | 视频直链类型 |
url | string | 视频播放直链 |
from | string | 视频原地址 |
返回示例:
{ "code": 200, "msg": "解析成功", "data": { "title": "烈焰 第1集", "type": "m3u8", "url": "https://cache.m.iqiyi.com/mus/2480798154854701/b57c1e2cd4e4da92ff1e6e3717572589/afbe8fd3d73448c9/0/20240312/e2/e5/211b7baf6a74bb7ed03bf678acb241de.m3u8?vt=0&ff=ts&qd_originate=h5&k_uid=qd5fxcqk4vfryxcf2ts7z33rr5usu5vt&fr=25&_lnt=0&qpdis-proc=cm10&px=&bossStatus=0&qd_p=6a550937&br=100&tls=true&bid=600&src=02020031010000000000&tm=1710530526930&qd_vip=1&code=2&qd_uri=dash&qd_time=1710530527625&tvid=5090243659387600&sgti=15_qd5fxcqk4vfryxcf2ts7z33rr5usu5vt_1710530526930&vf=ae1faabf4dd9485ead7339757dbac36c", "from": "https://www.iqiyi.com/v_1exqq3b7d8c.html" }, "time": 0.343076 }
请求参数设置:
参数名称 | 参数值 | 操作 |
---|---|---|
{ "code": 200, "msg": "解析成功", "data": { "title": "烈焰 第1集", "type": "m3u8", "url": "https://cache.m.iqiyi.com/mus/2480798154854701/b57c1e2cd4e4da92ff1e6e3717572589/afbe8fd3d73448c9/0/20240312/e2/e5/211b7baf6a74bb7ed03bf678acb241de.m3u8?vt=0&ff=ts&qd_originate=h5&k_uid=qd5fxcqk4vfryxcf2ts7z33rr5usu5vt&fr=25&_lnt=0&qpdis-proc=cm10&px=&bossStatus=0&qd_p=6a550937&br=100&tls=true&bid=600&src=02020031010000000000&tm=1710530526930&qd_vip=1&code=2&qd_uri=dash&qd_time=1710530527625&tvid=5090243659387600&sgti=15_qd5fxcqk4vfryxcf2ts7z33rr5usu5vt_1710530526930&vf=ae1faabf4dd9485ead7339757dbac36c", "from": "https://www.iqiyi.com/v_1exqq3b7d8c.html" }, "time": 0.343076 }
错误码格式说明:
名称 | 类型 | 说明 |
---|---|---|
100 | integer | URL错误 |
400 | integer | VF签名错误 |
404 | integer | 解析失败 |
代码示例:
1、GET请求
$api = 'https://api.leafone.cn/api/iqiyi?url=https://www.iqiyi.com/v_1exqq3b7d8c.html&cookie=xxxxxxxxxxxxxxxxxxx';
$res = curl($api);
2、POST请求
$api = 'https://api.leafone.cn/api/iqiyi';
$data = [
'url'=>'https://www.iqiyi.com/v_1exqq3b7d8c.html',
'cookie'=>'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
];
$res = curl($api, $data);
function curl($url, $data='') {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$return = curl_exec($curl);
curl_close($curl);
return $return;
}