PHP code example of mountainguan / ql-plugin-disguise

1. Go to this page and download the library: Download mountainguan/ql-plugin-disguise library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mountainguan / ql-plugin-disguise example snippets


use QL\QueryList;
use QL\Ext\DisguisePlugin;

$ql = QueryList::getInstance();
$ql->use(DisguisePlugin::class);
//or Custom function name
$ql->use(DisguisePlugin::class,'disguiseIp','disguiseUa');

print_r($ql->disguiseIp(
	array('headers'=>[	'Accept'=>'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
	'Accept-Encoding'=>'gzip, deflate, br',
	'Accept-Language'=>'en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7',
	'Connection'=>'keep-alive'])
    )->disguiseUa()->disguise_headers);

$ql = QueryList::getInstance();
$ql->use(DisguisePlugin::class);
$ql->disguiseIp()->disguiseUa()->get('http://httpbin.org/get',[
		'param1' => 'testvalue',
		'params2' => 'somevalue'
	],[
 	//设置超时时间,单位:秒
		'timeout' => 30,
		'headers' => [
		 'Referer' => 'https://querylist.cc/',
		'Accept'     => 'application/json',
		'X-Foo'      => ['Bar', 'Baz'],
		 'Cookie'    => 'abc=111;xxx=222'
	]
]);
echo $ql->getHtml();die;