From 938d3d532ab3963f18d53471531a4b96fb9611e7 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Fri, 6 Jan 2023 01:23:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EB=E7=AB=99=E5=A4=A7=E4=BC=9A?= =?UTF-8?q?=E5=91=98=E7=A7=AF=E5=88=86=E7=AD=BE=E5=88=B0=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DB=E7=AB=99=E6=93=8D=E4=BD=9C=E5=89=8D=E6=B2=A1?= =?UTF-8?q?=E5=81=9A=E7=99=BB=E9=99=86=E6=A0=A1=E9=AA=8C=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yutou/qqbot/bilibili/AppUserTask.java | 10 ++++++---- .../com/yutou/qqbot/bilibili/BiliBiliAppUtils.java | 1 + .../java/com/yutou/qqbot/bilibili/BiliBiliUtils.java | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/yutou/qqbot/bilibili/AppUserTask.java b/src/main/java/com/yutou/qqbot/bilibili/AppUserTask.java index 8f8217a..b5c2970 100644 --- a/src/main/java/com/yutou/qqbot/bilibili/AppUserTask.java +++ b/src/main/java/com/yutou/qqbot/bilibili/AppUserTask.java @@ -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; + private List 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; }; diff --git a/src/main/java/com/yutou/qqbot/bilibili/BiliBiliAppUtils.java b/src/main/java/com/yutou/qqbot/bilibili/BiliBiliAppUtils.java index 4bbb6b9..eed2770 100644 --- a/src/main/java/com/yutou/qqbot/bilibili/BiliBiliAppUtils.java +++ b/src/main/java/com/yutou/qqbot/bilibili/BiliBiliAppUtils.java @@ -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); } diff --git a/src/main/java/com/yutou/qqbot/bilibili/BiliBiliUtils.java b/src/main/java/com/yutou/qqbot/bilibili/BiliBiliUtils.java index 81b1ccc..5b61484 100644 --- a/src/main/java/com/yutou/qqbot/bilibili/BiliBiliUtils.java +++ b/src/main/java/com/yutou/qqbot/bilibili/BiliBiliUtils.java @@ -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) {