市面上那些所谓的无水印解析,有的调用第三方,有的就是打个广告,想让别人来调用自己的,然后引流,然后收费,博主参考了 强仔的抖音无水印接口 稍作修改,上传即用。

使用方法:打开抖音短视频APP,点开某个视频,点击右下角分享按钮,在分享弹框中点击复制链接或通过分享到微信QQ等获取分享链接,上传此源码,带上参数访问 例:http://127.0.0.1/api.php?url=https://v.douyin.com/J4trbnd
附:强仔搭建好的接口 - > https://qz.al/api/douyin/api.php?url=https://v.douyin.com/J4trbnd

接口代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
error_reporting(0);
header("Access-Control-Allow-Origin:*");
header("Content-type:application/json; charset=utf-8");
$www_vvhan_com = isset($_GET['url']) && $_GET['url'] != "" ? $_GET['url'] : exit(json_encode(array("success" => false, "message" => "参数不完整"), JSON_UNESCAPED_UNICODE));
$www_vvhan_com_url = get_headers($www_vvhan_com, true)["location"];
preg_match_all('/video\/(.*?)\/\?region/i', $www_vvhan_com_url, $out);
$www_vvhan_com_Arr = json_decode(www_Vvhan_Com("https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids={$out[1][0]}"), true);
preg_match_all('/href="(.*?)">Found/i', www_Vvhan_Com(str_replace('playwm', 'play', $www_vvhan_com_Arr['item_list'][0]["video"]["play_addr"]["url_list"][0])), $www_vvhan_com_OutDatas);
$www_vvhan_com_Jsons = array(
"success" => true,
"info" => [
'title' => $www_vvhan_com_Arr['item_list'][0]["share_info"]["share_title"],
'cover' => $www_vvhan_com_Arr['item_list'][0]['video']["origin_cover"]["url_list"][0],
'url' => $www_vvhan_com_OutDatas[1][0]
]
);
exit(json_encode($www_vvhan_com_Jsons, JSON_UNESCAPED_UNICODE));
function www_Vvhan_Com($www_vvhan_com)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $www_vvhan_com);
curl_setopt($ch, CURLOPT_USERAGENT, "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");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
$www_vvhan_com_OutPut = curl_exec($ch);
curl_close($ch);
return $www_vvhan_com_OutPut;
}
?>

返回示例

1
2
3
4
5
6
7
8
{
"success": true,
"info": {
"title": "当你在爱情中遇到“凡尔赛”大师,你会怎么做? # 恋爱 #cp @DOU+小助手",
"cover": "https://p9-dy.byteimg.com/tos-cn-p-0015/6fd9c25e85734b2aa2cda7174adb5348_1606730946~tplv-dy-360p.jpeg?from=2563711402",
"url": "http://v6.365yg.com/198b6557fbfb5c1419228754856081d2/5fd2eda9/video/n/tosedge-tos-aggdsz-ve-0000/a4aff3259c014b268077db2fbe16a322/?a=1128&amp;br=4830&amp;bt=1610&amp;cd=0%7C0%7C0&amp;cr=0&amp;cs=0&amp;cv=1&amp;dr=0&amp;ds=3&amp;er=&amp;l=20201211104957010198060166561E897E&amp;lr=&amp;mime_type=video_mp4&amp;qs=0&amp;rc=M3lucTc4aWhmeTMzZGkzM0ApZzc5Z2dkNDw7NzpkOzQ4PGdmL3FrMXNoNC9fLS00LTBzczZfMi4yMzY2NjM2XjQwMjA6Yw%3D%3D&amp;vl=&amp;vr="
}
}