介绍

正常保存视频是有水印的,本接口利用抖音官方API可以直接获取到无水印的视频链接等作品信息!

需要用到的接口

https://api.amemv.com/aweme/v1/aweme/detail/?aweme_id=这里填作品19位数字ID&origin_type=web&os_api=25&device_platform=android&device_type=SM-G9680&iid=1732462101135703&ssmix=a&manifest_version_code=870&dpi=320&js_sdk_version=1.19.2.0&version_code=870&app_name=aweme&version_name=8.7.0&ts=1589989250&openudid=87a5c1a71a400abe&device_id=307495029447198&resolution=1440x2960&os_version=7.1.2&language=zh&device_brand=samsung&app_type=normal&ac=wifi&update_version_code=8702&aid=1128&channel=aweGW&_rticket=1589989249689&mcc_mnc=46000

PHP代码获取实例

<?php
$json = file_get_contents('https://api.amemv.com/aweme/v1/aweme/detail/?aweme_id=6973088666310757645&origin_type=web&os_api=25&device_platform=android&device_type=SM-G9680&iid=1732462101135703&ssmix=a&manifest_version_code=870&dpi=320&js_sdk_version=1.19.2.0&version_code=870&app_name=aweme&version_name=8.7.0&ts=1589989250&openudid=87a5c1a71a400abe&device_id=307495029447198&resolution=1440x2960&os_version=7.1.2&language=zh&device_brand=samsung&app_type=normal&ac=wifi&update_version_code=8702&aid=1128&channel=aweGW&_rticket=1589989249689&mcc_mnc=46000');
    $res = json_decode($json,true);
    if(!$res['aweme_detail']['desc']){
        exit('{"code":0,"msg":"获取失败请重试"}');  
    }
    $video_info['code'] = 200;
    $video_info['msg'] = '获取作品信息成功';
    $video_info['video_name'] = $res['aweme_detail']['desc']; //视频名称
    $video_info['video_music'] = $res['aweme_detail']['video']['bit_rate'][0]['play_addr']['url_list'][3]; //视频音乐
    $video_info['video_img'] = $res['aweme_detail']['video']['origin_cover']['url_list'][0]; //视频缩略图
    $video_info['video_url'] = $res['aweme_detail']['video']['play_addr']['url_list'][3]; //视频无水印
    
    $video_info['user_img'] = $res['aweme_detail']['author']['avatar_larger']['url_list'][0]; //作者头像
    $video_info['user_name'] = $res['aweme_detail']['author']['nickname'];//作者昵称

    exit(json_encode($video_info)); //返回JSON格式输出
?>
最后修改:2021 年 09 月 17 日 02 : 51 AM
如果觉得我的文章对你有用,请随意赞赏
END
本文作者:
文章标题:抖音视频无水印解析接口PHP实例源码
本文地址:https://www.jufb.cn/archives/41.html
版权说明:若无注明,本文皆雨尘博客原创,转载请保留文章出处。