PHP哔哩哔哩签到接口GET请求
接口有了,就是不知道GET请求怎么写求大佬帮忙解决
接口就在这# 主站签到curl 'https://api.bilibili.com/x/web-interface/nav/stat' \
-H 'authority: api.bilibili.com' \
-H 'accept: application/json, text/plain, */*' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko' \
-H 'origin: https://www.bilibili.com' \
-H 'referer: https://www.bilibili.com/' \
-H 'cookie: _uuid=; buvid3=; bfe_id=; fingerprint=; buvid_fp=; buvid_fp_plain=; sid=; DedeUserID=; DedeUserID__ckMd5=; SESSDATA=; bili_jct='
# 直播签到
curl 'https://api.live.bilibili.com/sign/doSign' \
-H 'authority: api.live.bilibili.com' \
-H 'accept: application/json, text/plain, */*' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko' \
-H 'origin: https://live.bilibili.com' \
-H 'referer: https://live.bilibili.com/' \
-H 'cookie: _uuid=; buvid3=; fingerprint=; buvid_fp=; buvid_fp_plain=; sid=; DedeUserID=; DedeUserID__ckMd5=; SESSDATA=; bili_jct=; PVID=; LIVE_BUVID='
# b漫签到
curl -X POST 'https://manga.bilibili.com/twirp/activity.v1.Activity/ClockIn?platform=ios' \
-H 'accept: application/json, text/plain, */*' \
-H 'user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12F70 Safari/600.1.4' \
-H 'origin: https://live.bilibili.com' \
-H 'referer: https://live.bilibili.com/' \
-H 'cookie: _uuid=; buvid3=; fingerprint=; buvid_fp=; buvid_fp_plain=; sid=; DedeUserID=; DedeUserID__ckMd5=; SESSDATA=; bili_jct=; PVID=; LIVE_BUVID='
楼下可能会 看你用什么了 你想用什么写 本帖最后由 Jack2002 于 2021-7-29 16:07 编辑
要改成什么GET?python?易? https开头的是请求地址,-H开头的是请求头,改成哪个语言都不难吧!
更新你的COOKIE就行了,至于这个签到接口还能不能用我就不清楚了,
<?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> 随便自己封装个curl类就好了
页:
[1]