0

0

php使用curl抓取qq空间的访客信息示例_php技巧

php中文网

php中文网

发布时间:2016-05-17 08:48:40

|

1124人浏览过

|

来源于php中文网

原创

config.php

复制代码 代码如下:

define('APP_DIR', dirname(__FILE__));
define('COOKIE_FILE', APP_DIR . '/app.cookie.txt'); //会话记录文件
define('VISITOR_CAPTURE_INTERVAL', 3); //QQ采集间隔
define('VISITOR_DATA_UPLOAD_INTERVAL', '');
define('THIS_TIME', time());

define('REQUEST_TIMEOUT', 20); //请求超时20秒
define('END_LINE', "\n");
define('DEBUG', true); //开启调试

$login_users = array(
    array('user' => '2064556526', 'password' => '909124124951'),
    array('user' => '483258700', 'password' => '909124124951'),
    array('user' => '1990270522', 'password' => '909124124951'),
    array('user' => '2718711637', 'password' => '909124124951'),
    array('user' => '2841076562', 'password' => '909124124951'),
);

qy.visitor.php

复制代码 代码如下:

include('./config.php');
include(APP_DIR . '/qy.visitor.php');

$sessions = array();
$user = $login_users[array_rand($login_users)];

$visitor_capture = new QQVisitorCapture($user['user'], $user['password'], COOKIE_FILE, REQUEST_TIMEOUT, DEBUG, END_LINE);

$visitors = $visitor_capture->getVisitorInfo();

if (empty($visitors)) {
    $this->clearCookies(true);
} else {
    $cckf_service = new CCKFService(SECURITY_KEY,SERVICE_ID,SERVICE_ADDRESS,'', REQUEST_TIMEOUT, DEBUG, END_LINE);
}

qy.class.php

复制代码 代码如下:


class Trace
{
    public static function nl($num = 1)
    {
        $str = '';
        for ($i = 0; $i             $str .= "\n";
        }
        return $str;
    }

    public static function br($num = 1)
    {
        $str = '';
        for ($i = 0; $i             $str .= "
";
        }
        return $str;
    }

    public static function write($content, $end_line, $title = null)
    {
        $close = '^^^^^^^^^^^^^^^^^';

        if ($title) {
            $start = '--------' . $title . '---------';
        } else {
            $start = '-----------------';
        }

        echo $start . $end_line;

        if (is_array($content)) {
            print_r($content);
            echo $end_line;
        } else {
            echo $content;
            echo $end_line;
        }

        if (empty($content)) {
            echo $end_line;
        } else {
            echo $close . $end_line;
        }
    }

}


class Utils
{

    public static function getMicroTime()
    {
        list($mic, $time) = explode(" ", microtime());
        return intval($time) + floatval(sprintf('%.3f', $mic));
    }

    public static function getUTCMilliseconds()
    {
        return round(rand(1, 9) / 10 * 2147483647) * round(1, 999) % 10000000000;
    }

    public static function decodeURIComponent($content)
    {
        return urldecode(preg_replace("/\\\\x([0-9a-z]{2,3})/i", "%$1", $content));
    }

    public static function  jsRandom()
    {
        list($mic, $time) = explode(" ", microtime());
        return $mic;
    }

    function loginJsTime()
    {
        list($mic, $time) = explode(" ", microtime());
        return $time . sprintf('%3d', $mic * 1000);

    }

    protected static function utf8_unicode($c)
    {
        switch (strlen($c)) {
            case 1:
                return ord($c);
            case 2:
                $n = (ord($c[0]) & 0x3f)                 $n += ord($c[1]) & 0x3f;
                return $n;
            case 3:
                $n = (ord($c[0]) & 0x1f)                 $n += (ord($c[1]) & 0x3f)                 $n += ord($c[2]) & 0x3f;
                return $n;
            case 4:
                $n = (ord($c[0]) & 0x0f)                 $n += (ord($c[1]) & 0x3f)                 $n += (ord($c[2]) & 0x3f)                 $n += ord($c[3]) & 0x3f;
                return $n;
        }
    }

    public static function  getGTK($str)
    {
        $hash = 5381;
        for ($i = 0, $len = strlen($str); $i             $hash += ($hash         }
        return $hash & 2147483647;
    }

    protected static function hexchar2bin($str)
    {
        $arr = '';
        $temp = null;
        for ($i = 0; $i             $arr .= "\\x" . substr($str, $i, 2);
        }
        eval('$temp="' . $arr . '";');
        return $temp;
    }

    protected static function getUid($uid)
    {
        $temp = null;
        eval('$temp="' . $uid . '";');
        return $temp;
    }

    public static function getEncryption($password, $uin, $vcode)
    {
        $uin = self::getUid($uin);
        $str1 = self::hexchar2bin(strtoupper(md5($password)));
        $str2 = strtoupper(md5($str1 . $uin));
        return strtoupper(md5($str2 . strtoupper($vcode)));
    }

}

class CookieFileExtract
{
    protected $cookie_file;
    protected $cookie_list;

    protected function  __construct($cookie_file)
    {
        $this->cookie_file = $cookie_file;

        $this->cookie_list = $this->extractFile();
    }

    protected function isValidateCookieFile()
    {
        if ($this->cookie_file && file_exists($this->cookie_file)) {
            return true;
        } else {
            return false;
        }
    }

    protected function extractFile()
    {
        $cookie_list = array();

        if ($this->isValidateCookieFile($this->cookie_file)) {
            $content = file($this->cookie_file);
            if (is_array($content)) {
                foreach ($content as $line) {
                    $line = trim($line);
                    if (strlen($line) > 0 && $line[0] != '#') {
                        $cookie = (preg_split("/\s+/", $line));
                        if (count($cookie) == 7) {
                            $cookie_list[$cookie[5]] = $cookie[6];
                        } else {
                            $cookie_list[$cookie[5]] = '';
                        }
                    }
                }
            }
        }

        return $cookie_list;
    }

    protected function buildCookieStr($cookies)
    {
        $arr = array();

        if (is_array($cookies)) {
            foreach ($cookies as $k => $cookie) {
                $line = $cookie['domain'] . "\t" . "TRUE" . "\t" . $cookie['path'] . "\t" . "FALSE" . "\t" . $cookie['expires'] . "\t" . $k . "\t" . $cookie['value'];
                $arr[] = $line;
            }
        }
        return $arr;
    }

    protected function __setCookies($cookies)
    {
        $new_line = array();
        if (is_array($cookies)) {
            if ($this->isValidateCookieFile($this->cookie_file)) {
                $content = file($this->cookie_file);
                if (is_array($content)) {
                    foreach ($content as $line) {
                        $line = trim($line);
                        if (strlen($line) > 0 && $line[0] != '#') {
                            $cookie = (preg_split("/\s+/", $line));
                            if (!in_array($cookie[5], $cookies)) {
                                $new_line[] = $line;
                            }
                        } else {
                            $new_line[] = $line;
                        }
                    }
                }
            }

            file_put_contents($this->cookie_file, implode("\n", array_merge($new_line, $this->buildCookieStr($cookies))));
        }
    }

    protected function __getAllCookies($refresh = false)
    {
        if ($refresh) {
            $this->cookie_list = $this->extractFile();
        }
        return $this->cookie_list;
    }

    protected function __getCookie($cookie_name, $refresh = false)
    {
        $cookie_list = $this->__getAllCookies($refresh);

        if (is_array($cookie_list) && array_key_exists($cookie_name, $cookie_list)) {
            return $cookie_list[$cookie_name];
        } else {
            return null;
        }
    }

    protected function __clearAllCookies()
    {
        $this->cookie_list = null;
        @unlink($this->cookie_file);
    }
}

class BaseRequest extends CookieFileExtract
{

    protected $curl_instance;
    protected $request_timeout;
    protected $debug;
    protected $end_line;
    protected $user_agent = 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0';

    protected function __construct($cookie_file, $request_timeout, $debug, $end_line)
    {
        parent::__construct($cookie_file);
        $this->request_timeout = $request_timeout;
        $this->debug = $debug;
        $this->end_line = $end_line;
        $this->initInstance();
    }

    protected function initInstance()
    {

        $this->curl_instance = curl_init();

        if ($this->isValidateCookieFile()) {
            curl_setopt($this->curl_instance, CURLOPT_COOKIEJAR, $this->cookie_file);
            curl_setopt($this->curl_instance, CURLOPT_COOKIEFILE, $this->cookie_file);
        }

        curl_setopt($this->curl_instance, CURLOPT_TIMEOUT, $this->request_timeout);
        curl_setopt($this->curl_instance, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($this->curl_instance, CURLOPT_HEADER, 1);
        curl_setopt($this->curl_instance, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($this->curl_instance, CURLOPT_SSL_VERIFYHOST, 0);
        curl_exec($this->curl_instance);

    }

    function setCookies($cookies)
    {
        $this->closeInstance();
        $this->__setCookies($cookies);
        $this->initInstance();
    }

    protected function getAllCookies($refresh = false)
    {
        $this->closeInstance();
        $cookies = $this->__getAllCookies($refresh);
        $this->initInstance();
        return $cookies;
    }


    protected function clearAllCookies($refresh = false)
    {
        $this->closeInstance();
        $this->__clearAllCookies();

        if ($refresh) {
            $this->initInstance();
        }
    }

    protected function getCookie($name, $refresh = false)
    {
        $this->closeInstance();
        $cookie = $this->__getCookie($name, $refresh);
        $this->initInstance();
        return $cookie;
    }

    protected function getRequestInstance()
    {
        return $this->curl_instance;
    }

    protected function closeInstance()
    {
        if (is_resource($this->curl_instance)) {
            curl_close($this->curl_instance);
        }
    }

    protected function resetInstance()
    {
        $this->closeInstance();
        @unlink($this->cookie_file);
        $this->initInstance();
    }

    protected function requestExec($option)
    {

        curl_setopt_array($this->getRequestInstance(), $option);

        //if ($this->debug) {
        //    $result = curl_exec($this->getRequestInstance());
        //    Trace::write($result, $this->end_line, 'request output');
        //} else {
        return curl_exec($this->getRequestInstance());
        //}
    }
}

class QQVisitorRequest extends BaseRequest
{
    protected $user;
    protected $password;

    protected function __construct($user, $password, $cookie_file, $request_timeout, $debug, $end_line)
    {

        parent::__construct(dirname($cookie_file) . '/' . $user . '.' . basename($cookie_file), $request_timeout, $debug, $end_line);
        $this->user = $user;
        $this->password = $password;
    }
}


class ResultExtract
{

    public static function  getCoreJsInfo($content, $user)
    {
        $arr = array();
        preg_match('/cfg\s*=\s*\{(.*?)\s*\}\s*,\s*URL_PARAM_HASH/s', $content, $m);
        if (count($m) > 0) {
            $f = preg_replace('/\s*/', '', $m[1]);
            $f = preg_replace('/"\+g\_iLoginUin\+"/', $user, $f);
            $f = preg_replace('/\$j\.cookie.get\("hotfeeds_closed"\)==1\?""\:/', '', $f);

            $f = explode(",", $f);
            if (count($f) > 0) {
                foreach ($f as $t) {
                    $t = trim($t);
                    $p = strpos($t, ':');
                    $key = trim(substr($t, 0, $p), '"');
                    $value = trim(substr($t, $p + 1), '"');
                    if ($key) {
                        $arr[$key] = $value;
                    }
                }

                if (count($arr) > 0) {
                    $arr['visitor'] = $arr;
                }
            }
        }

        return $arr;
    }

    public static function  enterQzoneSuccess($content)
    {
        $arr = array();
        $arr2 = array();
        preg_match('/g_Data\s*=\s*{\s*feedsPart1\s*:\s*(.*?)\s*,\s*feedsPart2/s', $content, $m);

        if (count($m) > 0) {
            $f = preg_replace('/\s*/', '', $m[1]);
            $f = preg_replace('/([\{,])([^,]*?)(\:)/', '$1"$2"$3', $f);
            $f = preg_replace('/:\'(.*?)\'([,\}])/', ':"$1"$2', $f);
            $arr = json_decode($f, true);
            $arr = $arr['main'];
        }

        preg_match('/g_type.*?g_IZone_Flag/s', $content, $m);

        if (count($m) > 0) {
            $f = preg_replace('/\s*/', '', $m[0]);
            $f = explode(",", $f);

            foreach ($f as $t) {
                $t = trim($t);
                $p = strpos($t, '=');
                $key = trim(substr($t, 0, $p));
                $value = trim(substr($t, $p + 1), '"');
                if ($key) {
                    $arr2[$key] = $value;
                }
            }
        }

        return array_merge($arr, $arr2);

    }

    public static function getLoginJsInfo($content)
    {

ArrowMancer
ArrowMancer

手机上的宇宙动作RPG,游戏角色和元素均为AI生成

下载

        $s = preg_replace('/.*?pt\.plogin\s*=\s*\{(.*?)aqScanLink.*/s', '$1', $content);
        preg_match('/.*js_type\s*:\s*(\d+)\s*,.*/', $s, $m);

        if (count($m) > 1) {
            return array('js_type' => $m[1]);
        }

        return array();
    }

    public static function getLoginAddress($content)
    {
        preg_match('/.*?\s*.*?/', $content, $m);

        if (count($m) > 1) {
            return html_entity_decode($m[1]);
        }
        return null;
    }

    public static function checkLoginSuccess($content)
    {

        preg_match_all('/.*?\((.*)\).*?/', $content, $match);
        if ($match[1][0]) {
            $g = explode(',', $match[1][0]);
            if (count($g) > 1) {
                if (($g[count($g) - 2]) == "'登录成功!'") {
                    $url_parts = parse_url($g[2]);
                    parse_str($url_parts['query'], $arr);
                    if (array_key_exists('ptsig', $arr)) {
                        $ptsig = $arr['ptsig'];
                    } else {
                        $ptsig = null;
                    }
                    return array('status' => true, 'value' => array('url' => $g[2], 'ptsig' => $ptsig));
                }
            }
        }
        return array('status' => false);
    }


    public static function rightFrameVisitors($content)
    {
        $visitor_list = array();
        $f = preg_replace('/\s*/', '', $content);
        $f = preg_replace('/.*?_Callback\((\{.*?\})\).*?/', '$1', $f);
        $f = json_decode($f, true);

        if (is_array($f) && count($f) > 0 && array_key_exists('data', $f)
            && array_key_exists('module_3', $f['data'])
            && array_key_exists('data', $f['data']['module_3'])
            && array_key_exists('items', $f['data']['module_3']['data'])
        ) {

            $visitors = $f['data']['module_3']['data']['items'];

            foreach ($visitors as $visitor) {

                if (!array_key_exists('loc', $visitor)) {
                    $visitor_list [] = array(
                        'uin' => $visitor['uin'], 'name' => $visitor['name'], 'online' => $visitor['online'], 'time' => $visitor['time'],
                        'img' => $visitor['img'], 'yellow' => $visitor['yellow'], 'supervip' => $visitor['supervip'],
                    );
                }
            }
        }

        return $visitor_list;
    }

    public static function getVisitors($content)
    {

        $f = preg_replace('/\s*/', '', $content);
        preg_match('/^.*?(\{.*?\})\);\s*$/', $f, $m);

        $visitor_list = array();

        if (is_array($m) && count($m) > 1 && strlen($m[1]) > 0) {
            $visitors = json_decode(trim($m[1]), true);

            if (array_key_exists('data', $visitors) && array_key_exists('items', $visitors['data'])) {

                foreach ($visitors['data']['items'] as $visitor) {

                    if ($visitor['name']) {
                        $_ = array(
                            'uin' => $visitor['uin'], 'name' => $visitor['name'], 'time' => $visitor['time'],
                            'yellow' => $visitor['yellow'], 'supervip' => $visitor['supervip'],
                        );
                        if (array_key_exists('portraitlabel', $visitor)) {
                            $_['portraitlabel'] = $visitor['portraitlabel'];
                        }
                        $visitor_list[] = $_;

                        if (array_key_exists('uins', $visitor)) {
                            foreach ($visitor['uins'] as $uins) {
                                $_ = array(
                                    'uin' => $uins['uin'], 'name' => $uins['name'], 'time' => $uins['time'],
                                    'yellow' => $uins['yellow'], 'supervip' => $uins['supervip'],
                                );

                                if (array_key_exists('portraitlabel', $uins)) {
                                    $_['portraitlabel'] = $uins['portraitlabel'];
                                }
                                $visitor_list[] = $_;
                            }
                        }
                    }
                }
            }
        }
        return $visitor_list;
    }

    public static function  checkVC($content)
    {
        preg_match_all('/.*?\((.*)\).*?/', $content, $match);

        if (strlen($match[1][0]) > 1) {
            $m = str_replace("'", '', $match[1][0]);
            $g = explode(',', $m);

            if (count($g) == 3) {
                return array('saltUin' => $g[2], 'verifycode' => $g[1], 'RSAKey' => $g[2] ? false : true);
            }
        }
        return array();
    }

    public static function getLoginInfo($content)
    {
        $s = preg_replace('/.*?pt\.ptui\s*=\s*\{(.*?)\}\s*;.*/s', '$1', $content);
        $e = preg_split('/,\s*/', trim($s));

        $info = array();

        foreach ($e as $t) {

            $t = trim($t);
            $p = strpos($t, ':');
            $key = trim(substr($t, 0, $p));
            $value = trim(substr($t, $p + 1));

            if (preg_match('/encodeURIComponent/', $value)) {
                $value = preg_replace('/^encodeURIComponent\s*\(\s*"(.*)?"\s*\)\s*,?$/', '$1', $value);
            } else {
                $value = trim($value, '",');
            }

            if ($key) {
                $info[$key] = urldecode($value);
            }
        }
        return $info;
    }

}


class QQVisitorCapture extends QQVisitorRequest
{

    public function __construct($user, $password, $cookie_file, $request_timeout, $debug, $end_line)
    {
        parent:: __construct($user, $password, $cookie_file, $request_timeout, $debug, $end_line);
    }

    public function trace($content, $title)
    {
        if ($this->debug = true) {
            Trace:: write($content, $this->end_line, $title);
        }
    }

    public function error($message)
    {
        $this->trace($message, 'login error ');
        return false;
    }

    public function success()
    {
        return true;
    }

    public function getGTKEncryption()
    {
        return Utils ::getGTK($this->getCookie('skey', true));
    }

    public function getCookies($refresh = false)
    {
        return $this->getAllCookies($refresh);
    }

    public function clearCookies($refresh = false)
    {
        return $this->clearAllCookies($refresh);
    }

    public function login()
    {
        $login_submit_info_url = null;
        $login_submit_info_url = $this->visitQzone();

        $this->setCookies(array(
            'pgv_pvid' => array(
                'value' => Utils::getUTCMilliseconds(), 'path' => '/', 'domain' => '.qq.com', 'expires' => '0'
            ),
            'pgv_info' => array(
                'value' => 'ssid=s' . Utils::getUTCMilliseconds(), 'path' => '/', 'domain' => '.qq.com', 'expires' => '0'
            ),
            '_qz_referrer' => array(
                'value' => 'qzone.qq.com', 'path' => '/', 'domain' => '.qq.com', 'expires' => '0'
            ),
        ));

        //log
        $this->trace('', 'login begin');

        //log
        $this->trace($login_submit_info_url, '$login_submit_info_url===');

        $login_submit_info = $this->getLoginSubmitInfo($login_submit_info_url);

        //log
        $this->trace($login_submit_info, '$login_submit_info===');

        if (empty($login_submit_info)) {
            $this->error('err-001');
        }

        $this->report();

        //log
        $this->trace('', 'getLoginJs');
        $js_arr = $this->getLoginJs();

        //log
        $this->trace($js_arr, '$getLoginJs===');

        if (empty($js_arr)) {
            $this->error('err-002');
        }

        $u = $uin = $this->user;
        $r = Utils::jsRandom();
        $verifycode = null;
        $pt_rsa = null;
        $ptredirect = $login_submit_info['target'];
        $h = $t = $g = $from_ui = 1;
        $p = null;
        $regmaster = $login_submit_info['regmaster'];
        $u1 = Utils::decodeURIComponent($login_submit_info['s_url']);
        $ptlang = $login_submit_info['lang'];
        $action = strval(rand(5, 9)) . '-' . strval(strlen($this->user) + strlen($this->password) + rand(1, 5)) . '-' . Utils::loginJsTime();
        $js_ver = $login_submit_info['ptui_version'];
        $js_type = $js_arr['js_type'];
        $login_sig = $login_submit_info['login_sig'];
        $appid = $aid = $login_submit_info['appid'];
        $pt_qzone_sig = $login_submit_info['pt_qzone_sig'];
        $daid = $login_submit_info['daid'];

        //log
        $this->trace('', 'checkVC');
        $check_data = $this->checkVC($regmaster, $appid, $js_ver, $js_type, $login_sig, $u1, $r);

        if (count($check_data) !== 3) {
            $this->error('err-003');
        }

        //log
        $this->trace($check_data, '$check_data===');

        //log
        $this->trace(json_encode($check_data), '$check_data===');

        $verifycode = $check_data['verifycode'];

        if ($check_data['RSAKey']) {
            $this->error('err-004');
        } else {
            $p = Utils::getEncryption($this->password, $check_data['saltUin'], $verifycode);
            $pt_rsa = 0;
        }

        //log
        $this->trace('', 'submitLogin');

        $this->setCookies(array(
            'ptui_loginuin' => array(
                'value' => $this->user, 'path' => '/', 'domain' => '.qq.com', 'expires' => '0'
            ),
        ));

        $login_result = $this->submitLogin($verifycode, $p,
            $pt_rsa, $ptredirect, $u1,
            $h, $t, $g, $from_ui,
            $ptlang, $action, $js_ver, $js_type,
            $login_sig, $aid, $daid, $pt_qzone_sig);

        if ($login_result['status']) {
            $this->trace('登录成功', 'submitLogin');
            $this->trace($login_result, '$login_result====');
            $this->loginSuccessRedirect($login_result['value']['url']);
            $this->setCookies(array(
                'fnc' => array(
                    'value' => 1, 'path' => '/', 'domain' => '.qzone.qq.com', 'expires' => '0'
                ),
            ));
            $enterQzoneInfo = $this->enterQzone($login_result['value']['url'], $login_result['value']['ptsig']);

            //log
            $this->trace($enterQzoneInfo, '$enterQzoneInfo===');

            if ($enterQzoneInfo) {

                $this->trace('进入空间', 'enterQzone');

                //$referer = $login_result['value']['url'];
                //$scope = 0;

                //log
                $this->trace('', 'getCoreJs');
                $coreJsInfo = $this->getCoreJs();
                $this->trace($coreJsInfo, 'getCoreJs===');

                $this->setCookies(array(
                    'qzone_referer' => array(
                        'value' => $login_result['value']['url'], 'path' => '/', 'domain' => '.local.cckf123456789.com', 'expires' => '0'
                    ),
                    'qzone_visitor_param' => array(
                        'value' => implode('|', array_values($coreJsInfo['visitor'])), 'path' => '/', 'domain' => '.local.cckf123456789.com', 'expires' => '0'
                    ),
                ));

                //log
                //$this->trace('', 'rightFrameVisitor');
                //print_r($this->rightFrameVisitor($referer, implode('|', array_values($coreJsInfo['visitor']))));

                return $this->success();
            } else {
                $this->error('err-006');
            }

        } else {
            $this->error('err-005');
        }
    }

    protected function visitQzone()
    {
        $options = array(
            CURLOPT_TIMEOUT => $this->request_timeout,
            CURLOPT_HEADER => 1,
            CURLOPT_RETURNTRANSFER => 1,
            CURLOPT_URL => 'http://qzone.qq.com',
            CURLOPT_HTTPHEADER => array(
                'Referer:http://xui.ptlogin2.qq.com/cgi-bin/xlogin?proxy_url=http%3A//qzs.qq.com/qzone/v6/portal/proxy.html&daid=5&pt_qzone_sig=1&hide_title_bar=1&low_login=0&qlogin_auto_login=1&no_verifyimg=1&link_target=blank&appid=549000912&style=22&target=self&s_url=http%3A//qzs.qq.com/qzone/v5/loginsucc.html?para=izone&pt_qr_app=%E6%89%8B%E6%9C%BAQQ%E7%A9%BA%E9%97%B4&pt_qr_link=http%3A//z.qzone.com/download.html&self_regurl=http%3A//qzs.qq.com/qzone/v6/reg/index.html&pt_qr_help_link=http%3A//z.qzone.com/download.html',
                'User-Agent:' . $this->user_agent,
                'Host:qzone.qq.com',
                'Accept-Language:zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3',
                'Connection:keep-alive',)
        );

        return ResultExtract::getLoginAddress($this->requestExec($options));
    }

    protected function getLoginJs()
    {
        $options = array(
            CURLOPT_TIMEOUT => $this->request_timeout,
            CURLOPT_HEADER => 1,
            CURLOPT_RETURNTRANSFER => 1,
            CURLOPT_URL => 'http://imgcache.qq.com/ptlogin/ver/10067/js/c_login_old.js',
            CURLOPT_HTTPHEADER => array(
                'Referer:http://xui.ptlogin2.qq.com/cgi-bin/xlogin?proxy_url=http%3A//qzs.qq.com/qzone/v6/portal/proxy.html&daid=5&pt_qzone_sig=1&hide_title_bar=1&low_login=0&qlogin_auto_login=1&no_verifyimg=1&link_target=blank&appid=549000912&style=22&target=self&s_url=http%3A//qzs.qq.com/qzone/v5/loginsucc.html?para=izone&pt_qr_app=%E6%89%8B%E6%9C%BAQQ%E7%A9%BA%E9%97%B4&pt_qr_link=http%3A//z.qzone.com/download.html&self_regurl=http%3A//qzs.qq.com/qzone/v6/reg/index.html&pt_qr_help_link=http%3A//z.qzone.com/download.html',
                'User-Agent:' . $this->user_agent,
                'Host:imgcache.qq.com',
                'Connection:keep-alive',)
        );

        return ResultExtract::getLoginJsInfo($this->requestExec($options));
    }

    public function checkVC($regmaster, $appid, $js_ver, $js_type, $login_sig, $u1, $r)
    {

        $options = array(
            CURLOPT_TIMEOUT => $this->request_timeout,
            CURLOPT_HEADER => 1,
            CURLOPT_RETURNTRANSFER => 1,
            CURLOPT_URL => 'http://check.ptlogin2.qq.com/check?' . http_build_query(array(
                'regmaster' => $regmaster,
                'uin' => $this->user,
                'appid' => $appid,
                'js_ver' => $js_ver,
                'js_type' => $js_type,
                'login_sig' => $login_sig,
                'u1' => $u1,
                'r' => $r,
            )),
            CURLOPT_HTTPHEADER => array(
                'Referer:http://xui.ptlogin2.qq.com/cgi-bin/xlogin?proxy_url=http%3A//qzs.qq.com/qzone/v6/portal/proxy.html&daid=5&pt_qzone_sig=1&hide_title_bar=1&low_login=0&qlogin_auto_login=1&no_verifyimg=1&link_target=blank&appid=549000912&style=22&target=self&s_url=http%3A//qzs.qq.com/qzone/v5/loginsucc.html?para=izone&pt_qr_app=%E6%89%8B%E6%9C%BAQQ%E7%A9%BA%E9%97%B4&pt_qr_link=http%3A//z.qzone.com/download.html&self_regurl=http%3A//qzs.qq.com/qzone/v6/reg/index.html&pt_qr_help_link=http%3A//z.qzone.com/download.html',
                'User-Agent:' . $this->user_agent,
                'Host:check.ptlogin2.qq.com',
                'Accept-Language:zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3',
                'Connection:keep-alive',
            )
        );

        return ResultExtract::checkVC($this->requestExec($options));
    }

    protected function report()
    {
        $url = 'http://ui.ptlogin2.qq.com/cgi-bin/report?id=358342&t=' . Utils::jsRandom();

        $options = array(
            CURLOPT_TIMEOUT => $this->request_timeout,
         

相关文章

QQ
QQ

QQ是腾讯在中国开发的一款社交应用,用户可用QQ在手机和电脑上聊天。QQ截止目前拥有超过8.2亿用户,是中国最多人使用的社交应用程序之一,有需要的小伙伴快来保存下载体验吧!

下载

本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热门AI工具

更多
DeepSeek
DeepSeek

幻方量化公司旗下的开源大模型平台

豆包大模型
豆包大模型

字节跳动自主研发的一系列大型语言模型

通义千问
通义千问

阿里巴巴推出的全能AI助手

腾讯元宝
腾讯元宝

腾讯混元平台推出的AI助手

文心一言
文心一言

文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。

讯飞写作
讯飞写作

基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿

即梦AI
即梦AI

一站式AI创作平台,免费AI图片和视频生成。

ChatGPT
ChatGPT

最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。

相关专题

更多
拼多多赚钱的5种方法 拼多多赚钱的5种方法
拼多多赚钱的5种方法 拼多多赚钱的5种方法

在拼多多上赚钱主要可以通过无货源模式一件代发、精细化运营特色店铺、参与官方高流量活动、利用拼团机制社交裂变,以及成为多多进宝推广员这5种方法实现。核心策略在于通过低成本、高效率的供应链管理与营销,利用平台社交电商红利实现盈利。

28

2026.01.26

edge浏览器怎样设置主页 edge浏览器自定义设置教程
edge浏览器怎样设置主页 edge浏览器自定义设置教程

在Edge浏览器中设置主页,请依次点击右上角“...”图标 > 设置 > 开始、主页和新建标签页。在“Microsoft Edge 启动时”选择“打开以下页面”,点击“添加新页面”并输入网址。若要使用主页按钮,需在“外观”设置中开启“显示主页按钮”并设定网址。

8

2026.01.26

苹果官方查询网站 苹果手机正品激活查询入口
苹果官方查询网站 苹果手机正品激活查询入口

苹果官方查询网站主要通过 checkcoverage.apple.com/cn/zh/ 进行,可用于查询序列号(SN)对应的保修状态、激活日期及技术支持服务。此外,查找丢失设备请使用 iCloud.com/find,购买信息与物流可访问 Apple (中国大陆) 订单状态页面。

31

2026.01.26

npd人格什么意思 npd人格有什么特征
npd人格什么意思 npd人格有什么特征

NPD(Narcissistic Personality Disorder)即自恋型人格障碍,是一种心理健康问题,特点是极度夸大自我重要性、需要过度赞美与关注,同时极度缺乏共情能力,背后常掩藏着低自尊和不安全感,影响人际关系、工作和生活,通常在青少年时期开始显现,需由专业人士诊断。

3

2026.01.26

windows安全中心怎么关闭 windows安全中心怎么执行操作
windows安全中心怎么关闭 windows安全中心怎么执行操作

关闭Windows安全中心(Windows Defender)可通过系统设置暂时关闭,或使用组策略/注册表永久关闭。最简单的方法是:进入设置 > 隐私和安全性 > Windows安全中心 > 病毒和威胁防护 > 管理设置,将实时保护等选项关闭。

5

2026.01.26

2026年春运抢票攻略大全 春运抢票攻略教你三招手【技巧】
2026年春运抢票攻略大全 春运抢票攻略教你三招手【技巧】

铁路12306提供起售时间查询、起售提醒、购票预填、候补购票及误购限时免费退票五项服务,并强调官方渠道唯一性与信息安全。

35

2026.01.26

个人所得税税率表2026 个人所得税率最新税率表
个人所得税税率表2026 个人所得税率最新税率表

以工资薪金所得为例,应纳税额 = 应纳税所得额 × 税率 - 速算扣除数。应纳税所得额 = 月度收入 - 5000 元 - 专项扣除 - 专项附加扣除 - 依法确定的其他扣除。假设某员工月工资 10000 元,专项扣除 1000 元,专项附加扣除 2000 元,当月应纳税所得额为 10000 - 5000 - 1000 - 2000 = 2000 元,对应税率为 3%,速算扣除数为 0,则当月应纳税额为 2000×3% = 60 元。

12

2026.01.26

oppo云服务官网登录入口 oppo云服务登录手机版
oppo云服务官网登录入口 oppo云服务登录手机版

oppo云服务https://cloud.oppo.com/可以在云端安全存储您的照片、视频、联系人、便签等重要数据。当您的手机数据意外丢失或者需要更换手机时,可以随时将这些存储在云端的数据快速恢复到手机中。

40

2026.01.26

抖币充值官方网站 抖币性价比充值链接地址
抖币充值官方网站 抖币性价比充值链接地址

网页端充值步骤:打开浏览器,输入https://www.douyin.com,登录账号;点击右上角头像,选择“钱包”;进入“充值中心”,操作和APP端一致。注意:切勿通过第三方链接、二维码充值,谨防受骗

7

2026.01.26

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
PHP爬虫采集课程
PHP爬虫采集课程

共11课时 | 2.2万人学习

PHP使用CURL抓取页面
PHP使用CURL抓取页面

共4课时 | 2.9万人学习

Python Scrapy 网络爬虫实战视频教程
Python Scrapy 网络爬虫实战视频教程

共16课时 | 5.5万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号