MENU

抖音快手无水印解析PHP源码

• July 21, 2019 • Read: 468 • 资源分享阅读设置

解析抖音快手无水印视频-非第三方接口
抖音-快手解析源码
抖音-快手解析源码

<?php 
error_reporting(0); 
$act=isset($_GET['act'])?$_GET['act']:null;
$url=isset($_GET['url'])?$_GET['url']:null;
    switch($act){
        case 'ks':
            $reurl = substr($url,strpos($url,"http"));
            if(strpos($reurl," ")>0){
                $reurl = substr($reurl,0,strpos($reurl," "));
            }
            $url = getrealurl($reurl);
            preg_match('/photoId=(.*?)&/',$url,$photoId);
            $json = file_get_contents('https://api.kmovie.gifshow.com/rest/n/kmovie/app/photo/getPhotoById?WS&jjh_yqc&ws&photoId='.$photoId[1]);
            $res = json_decode($json,true);
            if(!empty($res['photo']['mainUrl'])){
                echo '{"code":1,"msg":"解析成功","url":"'.$res['photo']['mainUrl'].'","img":"'.$res['photo']['coverUrl'].'","name":"'.trim($res['photo']['caption']).'"}';
            }else{
                echo '{"code":-1,"msg":"未知错误"}';
            }
    break;
        case 'dy':
            $reurl = substr($url,strpos($url,"http"));
            if(strpos($reurl," ")>0){
                $reurl = substr($reurl,0,strpos($reurl," "));
            }
            $url = getrealurl($reurl);
            preg_match('/video\/(.*?)\//sS',$url,$dyid);
            ini_set('user_agent','user-agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Mobile Safari/537.36');
            $json = file_get_contents('https://api-hl.amemv.com/aweme/v1/aweme/detail/?aid=1128&app_name=aweme&version_code=251&aweme_id='.$dyid[1]);
            $res = json_decode($json,true);
            if(!empty($res['aweme_detail']['video']['play_addr']['url_list'][0])){
                echo '{"code":1,"msg":"解析成功","url":"'.$res['aweme_detail']['video']['play_addr']['url_list'][0].'","img":"'.$res['aweme_detail']['video']['origin_cover']['url_list'][0].'","name":"'.trim($res['aweme_detail']['share_info']['share_title']).'"}';
            }else{
                echo '{"code":-1,"msg":"未知错误"}';
            }
        break;
    default:
        exit('{"code":0,"msg":"No Act"}');
    break;
}
function getrealurl($url){
            @$header = get_headers($url,1);
            if (strpos($header[0],'301') || strpos($header[0],'302')) {
                if(is_array($header['Location'])) {
                    return $header['Location'][count($header['Location'])-1];
                }else{
                    return $header['Location'];
                }
            }else {
                return $url;
            }
        }
 ?>

Demo下载:点击下载

Archives QR Code Tip
QR Code for this page
Tipping QR Code
Leave a Comment

已有 15 条评论
  1. QQ QQ Windows 7 / Google Chrome

    980334344

  2. 晓光 晓光 Windows 7 / Google Chrome

    大佬,等你的最新快手解析

    1. 教书先生 教书先生 Windows 10 / Google Chrome

      @晓光tool.oioweb.cn 已经更新了

    2. 晓光 晓光 Windows 7 / Google Chrome

      @教书先生没有源码或者接口么

    3. QQ QQ Windows 7 / Google Chrome

      @晓光大佬加我qq

    4. 晓光 晓光 Windows 7 / Google Chrome

      @晓光大佬加我QQ980334344

  3. 晓光 晓光 Windows 7 / Google Chrome

    大佬,我等你

  4. 亢亢 亢亢 MacOS / Google Chrome

    快手有没有最新的解决方法

    1. 教书先生 教书先生 Windows 10 / Google Chrome

      @亢亢等等就有了

  5. 小桃子 小桃子 Android Pie / Google Chrome

    快手解析不行了??

    1. 教书先生 教书先生 Windows 10 / Google Chrome

      @小桃子等等

  6. repostone repostone Windows 8.1 / Google Chrome

    非技术的路过。

    1. 教书先生 教书先生 Windows 10 / Google Chrome

      @repostone哈哈,多来看看也是可以的

  7. 东方幻梦 东方幻梦 Windows 7 / Google Chrome

    你好秀啊,老哥。@(滑稽)抱走了抱走了#滑稽

    1. 教书先生 教书先生 Windows 10 / Google Chrome

      @东方幻梦还好还好@(滑稽)