屏蔽云端爬虫检测

本功能的作用是屏蔽厂商的云端检测功能,防止被劫持的风险

本功能对应的PHP SDK:https://github.com/wechaturl/wechat_url_api/blob/master/CheckIp_example.php

经过大数据分析发现,大部分云厂商会非法劫持http流量,或许比我们想象的严重,有部分大厂对劫持的内容做隐私大数据分析。

请求URL:

  • https://wechaturl.us/api/CheckIp.json

请求方式:

  • POST 或者GET(如果用GET,特殊字符串需要url编码)

参数:

参数名

必选

类型

说明

appid

int

appkey

string

ip

string

ip地址,目前只支持ipV4

返回示例,

  • https://wechaturl.us/api/CheckIp.json?appid=37****15&appkey=a50d38748960******80ae1a725b7c95&ip=124.225.192.171

{
  "code": 1,
  "msg": "blocked",
  "ip": "124.225.192.171",
  "message": "this ip is in blacklist.search_range 是本次检索范围。详细请咨询客服",
  "search_range": [
    "line",
    "tencent",
    "telegram",
    "360",
    "whatsapp",
    "alibaba",
    "facebook",
    "bytedance",
    "skype"
  ],
  "show_error_url": "https://www.google.com/error"
}
#请将上面的信息保存到session

返回结果怎么用

  1. 如果code=1,被拦截,直接给浏览器返回错误页面,如下面的例子;

code=0,不被拦截;

code>1,存在其他错误(详细查看)

2. search_range 是本次检索范围,目前已经支持主流厂商和浏览器.但是有些检索范围必须是“至尊会员+“,才能使用”。其中bytedance是今日头条和抖音+tiktok.详细请咨询客服

php:
new:: https://github.com/wechaturl/wechat_url_api/blob/master/CheckIp_example.php
<?php
if(is_numeric($CheckIpResult['code']) and $CheckIpResult['code']>1){
    exit($CheckIpResult['message']);
}else if($CheckIpResult['code']==1){
    //here,show  error page
    //http_response_code(404);
    //exit('page no found!');
    if(isset($CheckIpResult['show_error_url'])){
        exit(file_get_contents($CheckIpResult['show_error_url']));//当然,你可以自己写个网址
    }else{
        exit('page no found!');
    }
}
//下面就是你的代码
//echo '这里写你的代码吧';
?>
<?php 
//如果你的是静态单页面网站或者vue单页面,如./default.html,那使用下面方法
//echo file_get_contents('./default.html')
?>

查看所有CODE、STATUS值含义

最后更新于