MCPcopy Create free account
hub / github.com/OreosLab/bili / getVipPrivilege

Method getVipPrivilege

src/main/java/top/misec/api/OftenApi.java:39–53  ·  view source on GitHub ↗

type 1大会员B币券 2 大会员福利.

(int type)

Source from the content-addressed store, hash-verified

37 * type 1大会员B币券 2 大会员福利.
38 */
39 public static void getVipPrivilege(int type) {
40 String requestBody = "type=" + type
41 + "&csrf=" + ConfigLoader.helperConfig.getBiliVerify().getBiliJct();
42 JsonObject jsonObject = HttpUtils.doPost(ApiList.VIP_PRIVILEGE_RECEIVE, requestBody);
43 int responseCode = jsonObject.get("code").getAsInt();
44 if (responseCode == 0) {
45 if (type == 1) {
46 log.info("领取年度大会员每月赠送的B币券成功");
47 } else if (type == 2) {
48 log.info("领取大会员福利/权益成功");
49 }
50 } else {
51 log.warn("领取年度大会员每月赠送的B币券/大会员福利失败,原因: {}", jsonObject.get("message").getAsString());
52 }
53 }
54
55 /**
56 * 请求视频title,未获取到时返回bvid.

Callers 1

runMethod · 0.95

Calls 2

doPostMethod · 0.95
getBiliJctMethod · 0.80

Tested by

no test coverage detected