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
原文地址:https://www.cnblogs.com/yangchong/p/14982708.html