吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1405|回复: 5
收起左侧

[求助] PHP哔哩哔哩签到接口GET请求

[复制链接]
aedelnz 发表于 2021-7-24 16:51
接口有了,就是不知道GET请求怎么写
求大佬帮忙解决
接口就在这
[PHP] 纯文本查看 复制代码
# 主站签到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='

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

遇见乄 发表于 2021-7-24 22:18
楼下可能会
qq06314488 发表于 2021-7-24 22:39
Tendro 发表于 2021-7-24 23:10
Jack2002 发表于 2021-7-29 15:29
本帖最后由 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>
lianyi 发表于 2021-7-29 15:53
随便自己封装个curl类就好了
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-26 00:50

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表