php 抖音去水印

先贴丑图

php 抖音去水印_第1张图片

 

1、先复制抖音号,如:xiaosusu9117

2、根据抖音号获取用户的uid

function getUserId($uniq_id=''){
    __checkEmpty($uniq_id,"抖音号不能为空");
    $url = "https://www.douyin.com/aweme/v1/wallet/userinfo/?uniq_id={$uniq_id}&open_id=1&callback=__jp2";
    $data = json_decode(substr(get_curl($url), 6,-1),true);
    __checkEmpty($data["data"]["uid"],"解析用户id错误");

    return $data;
}

3、获取dytk、signature

function getjs($uid=''){
    __checkEmpty($uid,"缺少参数");
    $data= get_curl('https://www.douyin.com/share/user/'.$uid);
    $js = file_get_contents("./douyin_fuck.js");
    $tac = getSubstr($data,"tac='","'     $data = str_replace(array("\n","\r\n","  "),'',$data);
    $dytk = getSubstr($data,"dytk: '","'}");
    $file = str_replace('{$UA}',$_SERVER['HTTP_USER_AGENT'],file_get_contents('douyin_fuck.js'));
    $file = str_replace('{$uid}',$uid,$file);
    $file = str_replace('{$tac}',$tac,$file);
    $file = str_replace('{$dytk}',$dytk,$file);

    exit($file);
}

 

4、参数uid、signature、dytk请求获取列表。

function getShareData($uid='',$signature='',$dytk='',$max_cursor=0,$t=1){
    __checkEmpty($uid,"用户id为空");
    __checkEmpty($signature,"signature为空");
    __checkEmpty($dytk,"dytk为空");
    if ($t==1) $url = 'https://www.douyin.com/aweme/v1/aweme/post/?user_id='.$uid.'&count=80&max_cursor='.$max_cursor.'&aid=1128&_signature='.$signature.'&dytk='.$dytk;//作品
    else 'https://www.douyin.com/web/api/v2/aweme/like/?user_id='.$uid.'&count=80&max_cursor='.$max_cursor.'&aid=1128&_signature='.$signature.'&dytk='.$dytk;//喜欢
    $shareData = json_decode(get_curl($url),true);
    __checkEmpty($shareData["aweme_list"],"解析数据错误");
    
    return $shareData;
}

 

5、列表返回uri获取真实的url

function getzUrl($play_addr=''){
    __checkEmpty($play_addr,"play_addr为空");
    $url = "https://aweme.snssdk.com/aweme/v1/play/?video_id=".$play_addr."&line=0";
    $zUrl = get_curl($url,1,0);
    __checkEmpty($zUrl,"解析数据错误");
    return $zUrl;
}

 

http://v3-dy-z.ixigua.com/86f1f5a2a7b6ae99dfc2d019c80ab694/5d021c62/video/m/2203479e451e7a6488391fd319cd010ea0f116270d4500009164b692ddc5/?rc=ajo8cDd5OzdpbjMzZGkzM0ApQHRAbzc5NDYzNTU0NDM8OTY5PDNAKXUpQGczdSlAZjN2KUBmbGRqZXpoaGRmOzRAZWxha3IvbzAtXy0tXy0vc3MtbyNvI0EyNDU2LTItLTIxLi4tLi9pOmIucCM6YS1xIzpgLW8jbWwrYitqdDojLy5e

你可能感兴趣的:(php,php,抖音去水印)