首页 代码源码 正文 收录检测中

PHP官方API提供ck获取对方Q等级接口源码

提供ck可以免密查对方Q等级 只写了查等级 别的资料 你们需要写上或找我加上 分享分享思路。。。
接口里面提供了 自动更新ck 手下留情 不支持批量 配置吃不消 频率过快 会限制 停止提供ck更新
<?php
/**
 * 提供ck获取对方Q等级
 * @author 晓超云博客
 * @link https://blog.kit9.cn/
 * @time 2022年01月01日
 */
$qq='';//填写qq号
$skey='';//填写skey @带不带看你什么地方取得 安卓和网页都可以 
$p_skey='';//提供 p_skey 来源 vip.qq.com
$uin='';//被查询qq

$url = 'https://h5.vip.qq.com/p/mc/cardv2/other?qq='.$uin;
$Cookie = 'p_uin=o'.$qq.'; uin=o'.$qq.'; skey='.$skey.'; p_skey='.$p_skey;
$header = ['User-Agent: Mozilla/5.0 (Linux; Android 10; HLK-AL00 Build/HONORHLK-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.108 Safari/537.36 V1_AND_SQ_8.4.5_1468_YYB_D QQ/8.4.5.4745 NetType/4G WebP/0.4.1 Pixel/1080 StatusBarHeight/51 SimpleUISwitch/0 QQTheme/1000 InMagicWin/0'];
$data = teacher_curl($url,[
    'cookie'=>$Cookie,
    'Header'=>$header,
    'refer'=>'https://h5.vip.qq.com'
]);
preg_match('/<p><small>LV<\/small>(.*?)<\/p>/',$data,$data_level); 

if(!empty($data_level[1])){
    $json_data = array(
        'code'=>1,
        'level'=>$data_level[1]);
}else{
    $json_data = array(
        'code'=> 0,
        'data' => '未知错误'); 
}

echo json_encode($json_data,320);

function teacher_curl($url, $paras = array()){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    if (@$paras['Header']) {
        $Header = $paras['Header'];
    } else {
        $Header[] = "Accept:*/*";
        $Header[] = "Accept-Encoding:gzip,deflate,sdch";
        $Header[] = "Accept-Language:zh-CN,zh;q=0.8";
        $Header[] = "Connection:close";
    }
    curl_setopt($ch, CURLOPT_HTTPHEADER, $Header);
    if (@$paras['ctime']) { // 连接超时
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $paras['ctime']);
    } else {
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
    }
    if (@$paras['rtime']) { // 读取超时
        curl_setopt($ch, CURLOPT_TIMEOUT, $paras['rtime']);
    }
    if (@$paras['post']) {
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $paras['post']);
    }
    if (@$paras['header']) {
        curl_setopt($ch, CURLOPT_HEADER, true);
    }
    if (@$paras['cookie']) {
        curl_setopt($ch, CURLOPT_COOKIE, $paras['cookie']);
    }
    if (@$paras['refer']) {
        if ($paras['refer'] == 1) {
            curl_setopt($ch, CURLOPT_REFERER, 'http://m.qzone.com/infocenter?g_f=');
        } else {
            curl_setopt($ch, CURLOPT_REFERER, $paras['refer']);
        }
    }
    if (@$paras['ua']) {
        curl_setopt($ch, CURLOPT_USERAGENT, $paras['ua']);
    } else {
        curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36");
    }
    if (@$paras['nobody']) {
        curl_setopt($ch, CURLOPT_NOBODY, 1);
    }
    curl_setopt($ch, CURLOPT_ENCODING, "gzip");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    if (@$paras['GetCookie']) {
        curl_setopt($ch, CURLOPT_HEADER, 1);
        $result = curl_exec($ch);
        preg_match_all("/Set-Cookie: (.*?);/m", $result, $matches);
        $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
        $header = substr($result, 0, $headerSize); //状态码
        $body = substr($result, $headerSize);
        $ret = [
            "Cookie" => $matches, "body" => $body, "header" => $header, 'code' => curl_getinfo($ch, CURLINFO_HTTP_CODE)
        ];
        curl_close($ch);
        return $ret;
    }
    $ret = curl_exec($ch);
    if (@$paras['loadurl']) {
        $Headers = curl_getinfo($ch);
        $ret = $Headers['redirect_url'];
    }
    curl_close($ch);
    return $ret;
}

Q等级Q等级接口

上一篇
PHPQQ收藏内容解析接口源码
下一篇
QQ特别关心关注数量查询源码

还没有评论,快来抢沙发吧!