php无水印解析抖音视频接口,直接返回抖音视频链接地址。
<?php header("Content-Type: text/html;charset=utf-8");//设置编码 error_reporting (E_ALL & ~E_NOTICE); $url = $_GET['url']; if (empty($_GET['url']) || !isset($_GET['url'])) { echo "不在提供此接口,前往:https://api.tx7.co/n批量去抖音水印"; exit(); }else{ echo getUrl($url); } function getUrl($url){ $ollink = file_get_contents('https://139.199.12.35/api/getdylink?url='. $url ); if ($ollink == '') { $links = ['info' => '该视频已经失效,换个视频试试吧!']; return json_encode($links); }else{ $qsyvid = substr($ollink, strpos($ollink, '?')); $qsylink = 'https://aweme.snssdk.com/aweme/v1/play/'. $qsyvid; $tiaozhuan = file_get_contents('https://139.199.12.35/api/getdylinkv2?url='.$qsylink); } $links = ['cover'=>$cover,'old'=>$ollink,'new'=>$tiaozhuan]; return $tiaozhuan; } function getWebCode($url){ $curl = curl_init(); $UserAgent = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; .NET CLR 3.5.21022; .NET CLR 1.0.3705; .NET CLR 1.1.4322)'; 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); return curl_exec($curl); // return htmlspecialchars($output); curl_close($curl); } function centerStr($str,$leftStr,$rightStr){ $left = strpos($str, $leftStr); $right = strpos($str,$rightStr,$left); if ($left < 0 || $right < $right) { return false; exit(); } return substr($str, $left + strlen($leftStr),$right-$left-strlen($leftStr)); } function getRealLink($urls,$nm){ return substr(get_headers($urls)[$nm], 9); }
本文转载自:精准像素:11px.cn ,感谢作者分享实用知识