Last Published Dithering De watermark Interface Source code The main reason for the failure is that the trembling update request for the UA on the PC side cannot be played until the UA on the mobile phone side is requested once Source code It has been repaired!
<? php if (!empty($_GET['url'])) { $url = $_GET['url']; $str = GET($url, 1); preg_match("/video_id=(.*?)&/i", $str, $arr); if (count($arr) >= 1) { $str = GET(" https://aweme.snssdk.com/aweme/v1/play/?video_id= ".$arr[1]."&line=0", 0); preg_match('#<a href="(.*?)">#', $str, $arr2); if (count($arr2) >= 1) { $arr3 = explode("//", $arr2[1]);// Replace http with https to solve the problem perfectly if (!empty($arr3)) { //header("content-type:video/mp4"); //header("Location: "."https://".$arr3[1]); If (! Empty ($_GET ['way '])&&$_GET ['way']=="txt") {//plain text output exit("https://".$arr3[1]); } Else if (! Empty ($_GET ['way '])&&$_GET ['way']=="json") {//json text output $aray = ['code' =>200, 'msg' =>'success', 'url' =>"https://".$arr3[1]]; exit(json_encode($aray, false)); }Else {//Jump to play at a different address header("Location: "."https://".$arr3[1]); }}}} } else { Echo "What are the parameters; } function Get($url, $foll = 0) { //Initialization $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); // URL visited curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Full Silence curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Ignore https curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // Ignore https curl_setopt($ch, CURLOPT_HTTPHEADER, ["user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25"]); // UA curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $foll); // The default is $full=0 $output = curl_exec($ch); // Get content curl_close($ch); // close return $output; // return } ?>
API Call method
http://xxx/index.php?url= Treble video address