腾讯视频API接口 PHP版本
刚子 发布于 阅读:183
<?php
php动态获取腾讯视频mp4地址
$jsonstr=file_get_contents('http://vv.video.qq.com/getinfo?vids='.$videosrc.'&platform=101001&charge=0&otype=json');
$jsonstr=ltrim($jsonstr,'QZOutputJson=');
$jsonstr=rtrim($jsonstr,';');
$jsonarr=json_decode($jsonstr,true);
$videosrc=$jsonarr['vl']['vi'][0]['ul']['ui'][0]['url'].$jsonarr['vl']['vi'][0]['fn'].'?vkey='.$jsonarr['vl']['vi'][0]['fvkey'];
?>
$videosrc为腾讯视频链接里字符串,如下
https://v.qq.com/x/page/{$videosrc}.html