[原创]X音视频无水印解析稳定方式 支持长视频 PHP源码
本帖最后由 wushaominkk 于 2019-9-3 09:48 编辑没学过PHP,简单手打拼写的,但能够实现解析功能,这个是比较稳定的接口和方式,欢迎懂PHP的精简和指正
<?php
if(empty($_GET['url'])){
$_GET['url']="http://v.douyin.com/UvnoCP/";
};
$url = @$_GET['url'];
$UserAgent = 'Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_ENCODING, '');
curl_setopt($curl, CURLOPT_USERAGENT, $UserAgent);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
$html = curl_exec($curl);
function getSubstr($str, $leftStr, $rightStr) {
$left = strpos($str, $leftStr);
$right = strpos($str, $rightStr, $left);
if ($left < 0 or $right < $left) return '';
return substr($str, $left + strlen($leftStr) , $right - $left - strlen($leftStr));
}
$Dytk = getSubstr($html, 'dytk: "', '" }');
$ItemId = getSubstr($html, 'itemId: "', '",');
$url = 'https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids='.$ItemId.'&dytk='.$Dytk;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_ENCODING, '');
curl_setopt($curl, CURLOPT_USERAGENT, $UserAgent);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
$a = curl_exec($curl);
$Array = json_decode($a,true);
$mp4 = $Array["item_list"]["video"]["play_addr_lowbr"]["url_list"];
?> 小航 发表于 2019-9-2 20:49
https://xhboke.com/
你这是哪个地址的接口解析的?这个帖子里的接口没办法解析长视频啊 院主 发表于 2019-9-1 21:47
http://v.douyin.com/P9Wdmg/这个类型的5分钟长视频还是解析不了
https://xhboke.com/ 秀!天秀,。。。。这个是个好东西啊,水印都给搞没了。 感谢分享!! 怎么用? 正好需要,感谢楼主!! 不会用怎么办 谢谢分享 网页接口不能解析长视频 感谢楼主分享 这个接口没有长视频吧...
页:
[1]
2