解析腾讯视频真实地址
标签(空格分隔): php
分析
1 我们从腾讯视频上找到的网页链接格式是这样的
https://v.qq.com/x/page/b0136et5ztz.html
vid = b0136et5ztz
2 把vid放单到接口上
http://vv.video.qq.com/getinfo?vids=b0136et5ztz&platform=101001&charge=0&otype=json
3 php发送curl请求
去除 QZOutputJson= 和 最后的分号就行json解析
取出:url [第一个url] | fn | vkey
真实地址:url + fn + '?vkey=' + fvkey
$url = 'http://vv.video.qq.com/getinfo?vids=b0136et5ztz&platform=101001&charge=0&otype=json';
$tencentVideoInfo = curl_request($url);
$tencentVideoJson = substr(explode('QZOutputJson=',$tencentVideoInfo)[1],0,-1);
$tencentVideoArray = json_decode($tencentVideoJson,true);
$fvkey = $tencentVideoArray['vl']['vi'][0]['fvkey'];
$fn = $tencentVideoArray['vl']['vi'][0]['fn'];
$url = $tencentVideoArray['vl']['vi'][0]['ul']['ui'][0]['url'];
$video_url = $url.$fn.'?vkey='.$fvkey;
return json(200, $video_url);
转至:https://blog.csdn.net/weixin_39952502/article/details/115812860
评论