本帖最后由 Jack2002 于 2021-7-29 16:07 编辑
要改成什么GET?python?易? https开头的是请求地址,-H开头的是请求头,改成哪个语言都不难吧!
更新你的COOKIE就行了,至于这个签到接口还能不能用我就不清楚了,
[PHP] 纯文本查看 复制代码 <?php
function SignIn4B($url, $referer, $cookie) {
$header = array();
$header[] = 'authority: api.bilibili.com';
$header[] = 'Accept: application/json, text/plain, */*';
$header[] = 'origin: https://www.bilibili.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko');
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
//规避SSL验证
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//跳过HOST验证
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>签到</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
</head>
<body>
<?php
$url = "https://api.bilibili.com/x/web-interface/nav/stat";
$referer = "https://www.bilibili.com/";
$cookie = "your cookie";
$res = SignIn4B($url, $referer, $cookie);
echo $res;
?>
</body>
</html> |