转自hostloc论坛
这个是利用抖音官方api接口来去除短视频水印的方法,这里做个记录。
Found/', $res, $matches); $Xurl = str_replace('&', '&', $matches[1]); $res = qqxz_http_get($Xurl); preg_match('/itemId: "(.*?)",/', $res, $matches); $itemId = $matches[1]; $url = 'https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids=' . $itemId; $res = qqxz_http_get($url); $arr = json_decode($res, true);//作品信息获取 $play_addr_url = $arr['item_list'][0]["video"]["play_addr"]["url_list"][0]; $res = qqxz_http_get($play_addr_url); preg_match('/href="(.*?)">Found/', $res, $matches); $videoUrl = str_replace('&', '&', $matches[1]); $douyin = ['code' => 1, 'url' => $videoUrl]; echo json_encode($douyin); function qqxz_http_get($url) { $Header=array( "User-Agent:Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"); $con=curl_init((string)$url); curl_setopt($con,CURLOPT_HEADER,False); curl_setopt($con,CURLOPT_SSL_VERIFYPEER,False); curl_setopt($con,CURLOPT_RETURNTRANSFER,true); curl_setopt($con,CURLOPT_HTTPHEADER,$Header); curl_setopt($con,CURLOPT_TIMEOUT,5000); $result = curl_exec($con); return $result; } ?>
sicnature ---------------------------------------------------------------------
I P 地 址: 18.226.180.174
区 域 位 置: 美国俄亥俄
系 统 信 息:
Original content, please indicate the source:
同福客栈论坛 | 蟒蛇科普 | 海南乡情论坛 | JiaYu Blog
sicnature ---------------------------------------------------------------------
Welcome to reprint. Please indicate the source https://myzhenai.com/post/3286.html
1 评论
https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids={$vid}
https://www.iesdouyin.com/aweme/v1/web/aweme/detail/?aweme_id={$vid}
官方的接口已经失效了,不知道是什么原因,通过其他方法可以修正。