最新PHP解析抖音方法,大家低调使用,就怕人家又换接口了,上代码!
$receive_data='https://v.douyin.com/******/';//这里换成你的链接
$receive_header=$_SERVER['HTTP_USER_AGENT'];
//判断url参数有没有编码
$shareUrl=is_url_decode($receive_data);
//获取视频详情页信息
$shareUrl_href = get_content_url($shareUrl);
preg_match('/href="(.*?)">Found/', $shareUrl_href, $videoUrl);
$videoUrl=$videoUrl[1];
//获取页面ID
$itemId=getSubstr($videoUrl, "video/", "/?");
$apiUrl = "https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids=".$itemId;
$content = json_decode(get_content_url($apiUrl),true);
$video_data=get_content_url(str_replace("playwm","play",$content['item_list'][0]['video']['play_addr']['url_list'][0]),$receive_header);
preg_match('/<a href="(.*?)">Found/', $video_data, $videos_video);
$result_data=[
'title'=>$content['item_list'][0]['desc'],
'music'=>[
'title'=>$content['item_list'][0]['music']['title'],
'author'=>$content['item_list'][0]['music']['author'],
'cover'=>$content['item_list'][0]['music']['cover_large']['url_list'][0],
'audio'=>$content['item_list'][0]['music']['play_url']['uri']
],
'author'=>[
'nickname'=>$content['item_list'][0]['author']['nickname'],
'signature'=>$content['item_list'][0]['author']['signature'],
'avatar'=>$content['item_list'][0]['author']['avatar_larger']['url_list'][0]
],
'videos'=>[
'cover'=>$content['item_list'][0]['video']['cover']['url_list'][0],
'ratio'=>$content['item_list'][0]['video']['ratio'],
'video'=>$videos_video[1]
],
'shareUrl'=>$shareUrl
];
return $result_data;
//或
//print_r($result_data);注意:最好是手机端调用这个接口,并且header中的HTTP_USER_AGENT最好是你当前访问的header,否则视频还是有水印,并且还会无法播放
抖音
2022-03-01 1698抖音是目前最火的短视频平台,作为互联网行业的er们当然不能掉队,我的站长站为您整理收集了关于抖音相关的学习资源,包含抖音培训教程,抖音营销软件下载和搬运工必...
- 免登录H5快手商城/抖音小店运营版源码 [2024-10-13]
- 抖音无水印解析PHP接口代码分享 [2024-09-23]
- BlueCatKoKo抖音短视频下载工具V1.1.6,无须获取cookie [2024-09-11]
- 抖音短视频无水印一键批量下载神器 [2024-01-20]
- thinkphp抖音短视频矩阵云混剪营销系统源码V2.2.1免授权版 [2024-01-10]


