抖音快手去水印解析APi源码下载

[源码类型]:网站源码

[相关推荐]:去水印源码 抖音去水印 快手视频去水印 API源码 抖音解析

[文件大小]:

[下载权限]:1金币 / VIP会员

立即下载
抖音快手去水印解析APi源码

源码介绍

源码说明

抖音快手去水印解析API源码,目前支持抖音和快手,数据都是从原服务器取来的,没有从html结果抓,应该算是比较稳定一点, 其他平台的函数有空写完再补
一共五个函数
1、analyzing 平台解析
2、douyin 抖音视频处理
3、kuaishou 快手视频处理
4、httpRequest curl封装函数
5、result 返回处理

抖音快手去水印解析APi源码
去水印APi源码截图

调用示例:

require'CWaterMask.php';echogetUrl();functiongetUrl(){$data=CWaterMask::analyzing($_GET['url']);return$data;}

代码贴上

<?phpclassCWaterMask{staticpublicfunctionanalyzing($url){preg_match('/([w-]+.)+w+(:d{2,6})?/',$url,$domain);switch($domain[0]){case'':returnself::result(500,'请传入解析url参数,例:http://www.123.com/?url=https://v.douyin.com/ehHpu7V/');break;case'v.douyin.com':returnself::douyin($url);break;case'v.kuaishou.com':returnself::kuaishou($url);break;default:returnself::result(500,'抱歉,此url暂不支持!');}}staticpublicfunctiondouyin($url){$url=self::httpRequest($url,'GET');preg_match('/(?<=video/)d*(?=/?region)/',$url['location'],$matches);$item_ids=$matches[0];$vidoUrl='https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids='.$item_ids;$result=self::httpRequest($vidoUrl,'GET');$vid=$result['response']['item_list'][0]['video']['play_addr']['uri'];if(isset($vid)){$video_url='https://aweme.snssdk.com/aweme/v1/play/?video_id='.$vid.'&ratio=720p&line=0';$music=$result['response']['item_list'][0]['music']['play_url']['uri'];$nickname=$result['response']['item_list'][0]['author']['nickname'];$return=array('nickname'=>$nickname,'video_url'=>$video_url,'music'=>$music);returnself::result(200,$return);}else{returnself::result(500,'解析出错!');}}staticpublicfunctionkuaishou($url){$vurl=self::httpRequest($url,'GET');preg_match('/(?<=video/)w*(?=?fid)/',$vurl['location'],$matches);$str_qury1='queryvisionVideoDetail($photoId:String,$type:String,$page:String,$webPageArea:String)';$str_qury2='(photoId:$photoId,type:$type,page:$page,webPageArea:$webPageArea)';$query=array("operationName"=>"visionVideoDetail","variables"=>array('photoId'=>$matches[0],"page"=>"detail"),"query"=>$str_qury1."{nvisionVideoDetail".$str_qury2."{nphoto{nidndurationncaptionnlikeCountnrealLikeCountncoverUrlnphotoUrln}n}n}n",);$query=json_encode($query,320);$headers=array('content-type:application/json','Referer:'.$vurl['location']);$result=self::httpRequest('https://video.kuaishou.com/graphql','POST',$query,$headers);if(isset($result['response']['data']['visionVideoDetail']['photo']['photoUrl'])){returnself::result(200,$result['response']['data']['visionVideoDetail']['photo']);}else{returnself::result(500,'解析出错!');}}staticpublicfunctionhttpRequest($url,$method='POST',$postfields=null,$headers=array()){$method=strtoupper($method);$ci=curl_init();curl_setopt($ci,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_0);curl_setopt($ci,CURLOPT_CONNECTTIMEOUT,60);curl_setopt($ci,CURLOPT_TIMEOUT,30);curl_setopt($ci,CURLOPT_RETURNTRANSFER,1);switch($method){case"POST":curl_setopt($ci,CURLOPT_POST,true);if(!empty($postfields)){$tmpdatastr=is_array($postfields)?http_build_query($postfields):$postfields;curl_setopt($ci,CURLOPT_POSTFIELDS,$tmpdatastr);}break;default:curl_setopt($ci,CURLOPT_CUSTOMREQUEST,$method);break;}$ssl=preg_match('/^https:///i',$url)?TRUE:FALSE;curl_setopt($ci,CURLOPT_URL,$url);if($ssl){curl_setopt($ci,CURLOPT_SSL_VERIFYPEER,FALSE);curl_setopt($ci,CURLOPT_SSL_VERIFYHOST,FALSE);}curl_setopt($ci,CURLOPT_FOLLOWLOCATION,1);curl_setopt($ci,CURLOPT_MAXREDIRS,2);curl_setopt($ci,CURLOPT_HTTPHEADER,$headers);curl_setopt($ci,CURLINFO_HEADER_OUT,true);$response=json_decode(curl_exec($ci),true);$requestinfo=curl_getinfo($ci);$http_code=curl_getinfo($ci,CURLINFO_HTTP_CODE);$location=curl_getinfo($ci,CURLINFO_EFFECTIVE_URL);curl_close($ci);returnarray('location'=>$location,'response'=>$response,'requestinfo'=>$requestinfo);}staticpublicfunctionresult($errno=0,$data=''){header("Content-type:application/json;charset=utf-8");$errno=intval($errno);$result=array('code'=>$errno,'message'=>$data);returnjson_encode($result,320);}}

说下小白直接运行的问题
1、复制代码保存为CWaterMask.php
2、复制调用示例里面的代码 保存为index.php
3、放在同一个目录,假设目录为shuiyin
4、丢在服务器,域名访问 域名/shuiyin/?url=抖音或快手短链接
或者下载下面的包,解压,文件丢在服务器,按照4操作

源码下载地址

下载即代表您已阅读并同意以下条款:
1、所有资源仅供学习与参考,请学习后自行删除。本站不提供任何技术支持。
2、本站不保证资源的完整性、可用性、安全性。(单独付费源码除外)
3、如有侵犯您的版权,请及时联系我们,我们将下架处理。