新增B站大会员积分签到
修复B站操作前没做登陆校验的问题
This commit is contained in:
parent
5d15f24847
commit
938d3d532a
@ -3,6 +3,7 @@ package com.yutou.qqbot.bilibili;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ -12,7 +13,7 @@ public class AppUserTask {
|
||||
private long progress;
|
||||
private long target;
|
||||
private Wallet wallet;
|
||||
private List<WeekTask> weekTask;
|
||||
private List<WeekTask> weekTask = new ArrayList<>();
|
||||
private long weekTotal;
|
||||
private long weekGroup;
|
||||
private DayTask dayTask;
|
||||
@ -35,8 +36,9 @@ public class AppUserTask {
|
||||
|
||||
public String toMessageFormat() {
|
||||
return switch (getStatus()) {
|
||||
case 0 -> "不可领取,需要发送弹幕:" + getTarget() + ",进度:" + getProgress();
|
||||
case 2 -> "未领取";
|
||||
case 0 -> "不可领取,需要发送弹幕数:" + getTarget() + ",进度:" + getProgress();
|
||||
case 1 -> "进行中,需要发送弹幕数:" + getTarget() + ",进度:" + getProgress();
|
||||
case 2 -> "可领取";
|
||||
case 3 -> "已领取";
|
||||
default -> "未知状态:" + this;
|
||||
};
|
||||
@ -64,7 +66,7 @@ public class AppUserTask {
|
||||
return switch (getStatus()) {
|
||||
case 0 ->
|
||||
"任务id:" + id + ",不可领取, 进度天数:" + totalNum + ",需要天数:" + minimalDay + ",任务奖励电池:" + rewardNum;
|
||||
case 2 -> "任务id:" + id + ":未领取" + ",任务奖励电池:" + rewardNum;
|
||||
case 2 -> "任务id:" + id + ":可领取" + ",任务奖励电池:" + rewardNum;
|
||||
case 3 -> "任务id:" + id + ":已领取" + ",任务奖励电池:" + rewardNum;
|
||||
default -> "未知状态:" + this;
|
||||
};
|
||||
|
@ -102,6 +102,7 @@ public class BiliBiliAppUtils {
|
||||
|
||||
public AppUserTask getTaskProgress() {
|
||||
JSONObject task = biliUtils.http_get("https://api.live.bilibili.com/xlive/app-ucenter/v1/userTask/GetUserTaskProgress");
|
||||
System.out.println("task = " + task);
|
||||
assert task != null;
|
||||
return task.getObject("data", AppUserTask.class);
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ public class BiliBiliUtils {
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
public static void main(String[] args) {
|
||||
/* String url="https://xy218x85x123x8xy.mcdn.bilivideo.cn:4483/upgcxcode/12/12/17281212/17281212-16-80.flv?e=ig8euxZM2rNcNbNBhbdVhwdlhbUghwdVhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1660538573&gen=playurlv2&os=mcdn&oi=2936701972&trid=00006f9623cac1514d8ea18fba3a15a756cau&mid=96300&platform=pc&upsig=25ddd1da610960e8e1d2e80dc97c2361&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,mid,platform&mcdnid=11000101&bvc=vod&nettype=0&orderid=0,2&agrr=1&bw=253116&logo=A0000400&requestFrom=BILIBILI_HELPER_2.5.8";
|
||||
File file=download(url,"16.mp4",false);
|
||||
System.out.println("file.getAbsolutePath() = " + file.getAbsolutePath());*/
|
||||
@ -364,7 +364,7 @@ public class BiliBiliUtils {
|
||||
JSONObject toCoin = http_post("https://api.live.bilibili.com/xlive/revenue/v1/wallet/silver2coin", HttpTools.toUrlParams(body));
|
||||
JSONObject liveSign = http_get("https://api.live.bilibili.com/xlive/web-ucenter/v1/sign/DoSign");
|
||||
JSONObject vipSign = http_post("https://api.bilibili.com/pgc/activity/score/task/sign", null);
|
||||
return "银瓜子兑换硬币:"+toCoin.getString("message") + "|" +"直播签到:"+ liveSign.getString("message")+"|大会员中心签到:"+vipSign.getString("message");
|
||||
return "银瓜子兑换硬币:" + toCoin.getString("message") + "|" + "直播签到:" + liveSign.getString("message") + "|大会员中心签到:" + vipSign.getString("message");
|
||||
}
|
||||
|
||||
public JSONObject getLiveRoom(int roomId) {
|
||||
|
Loading…
Reference in New Issue
Block a user