From d886824f461967be1b3d443d05c68dc94a57effb Mon Sep 17 00:00:00 2001 From: Initial-heart-1 Date: Fri, 9 Jun 2023 09:07:28 +0800 Subject: [PATCH 1/5] feat: add CustomComicId and CustomEpId --- .../BiliBiliAgent/Interfaces/IMangaApi.cs | 4 ++-- src/Ray.BiliBiliTool.Config/Options/DailyTaskOptions.cs | 9 +++++++++ src/Ray.BiliBiliTool.Console/appsettings.json | 4 +++- src/Ray.BiliBiliTool.DomainService/MangaDomainService.cs | 4 ++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Interfaces/IMangaApi.cs b/src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Interfaces/IMangaApi.cs index 903d5405c..3662e57a9 100644 --- a/src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Interfaces/IMangaApi.cs +++ b/src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Interfaces/IMangaApi.cs @@ -26,8 +26,8 @@ public interface IMangaApi : IBiliBiliApi /// /// /// - [HttpPost("/twirp/bookshelf.v1.Bookshelf/AddHistory?platform={platform}&comic_id=27355&ep_id=381662")] - Task ReadManga(string platform); + [HttpPost("/twirp/bookshelf.v1.Bookshelf/AddHistory?platform={platform}&comic_id={comic_id}&ep_id={ep_id}")] + Task ReadManga(string platform, int comic_id, int ep_id); /// /// 获取会员漫画奖励 diff --git a/src/Ray.BiliBiliTool.Config/Options/DailyTaskOptions.cs b/src/Ray.BiliBiliTool.Config/Options/DailyTaskOptions.cs index da828c8e7..808301b88 100644 --- a/src/Ray.BiliBiliTool.Config/Options/DailyTaskOptions.cs +++ b/src/Ray.BiliBiliTool.Config/Options/DailyTaskOptions.cs @@ -77,6 +77,15 @@ public string ChargeComment /// public string DevicePlatform { get; set; } = "android"; + /// + /// 自定义漫画阅读 comic_id + /// + public int CustomComicId { get; set; } = 27355; + + /// + /// 自定义漫画阅读 ep_id + /// + public int CustomEpId { get; set; } = 381662; public List SupportUpIdList { diff --git a/src/Ray.BiliBiliTool.Console/appsettings.json b/src/Ray.BiliBiliTool.Console/appsettings.json index 89740733a..ddcba8713 100644 --- a/src/Ray.BiliBiliTool.Console/appsettings.json +++ b/src/Ray.BiliBiliTool.Console/appsettings.json @@ -15,7 +15,9 @@ "ChargeComment": "", //充电后留言 "DayOfReceiveVipPrivilege": 1, //每月几号自动领取会员权益的[-1,31],-1表示不指定,默认每月1号;0表示不自动领取 "DayOfExchangeSilver2Coin": 0, //每月几号执行银瓜子兑换硬币[-1,31],-1表示不指定,默认每月最后一天;-2表示每天;0表示不进行兑换 - "DevicePlatform": "android" //执行客户端操作时的平台 [ios,android] + "DevicePlatform": "android", //执行客户端操作时的平台 [ios,android] + "CustomComicId": "27355", //自定义漫画阅读 comic_id,若不清楚含义请勿修改 + "CustomEpId": "381662" //自定义漫画阅读 ep_id,若不清楚含义请勿修改 }, "LiveLotteryTaskConfig": { diff --git a/src/Ray.BiliBiliTool.DomainService/MangaDomainService.cs b/src/Ray.BiliBiliTool.DomainService/MangaDomainService.cs index 4459f4625..d803fba94 100644 --- a/src/Ray.BiliBiliTool.DomainService/MangaDomainService.cs +++ b/src/Ray.BiliBiliTool.DomainService/MangaDomainService.cs @@ -62,11 +62,11 @@ public async Task MangaSign() /// public async Task MangaRead() { - BiliApiResponse response = await _mangaApi.ReadManga(_dailyTaskOptions.DevicePlatform); + BiliApiResponse response = await _mangaApi.ReadManga(_dailyTaskOptions.DevicePlatform, _dailyTaskOptions.CustomComicId, _dailyTaskOptions.CustomEpId); if (response.Code == 0) { - _logger.LogInformation("【漫画阅读】成功, 阅读漫画为:堀与宫村"); + _logger.LogInformation("【漫画阅读】成功"); } else { From f4ff3a69c3aecf83f9db477b8ba45f83e6c6edc2 Mon Sep 17 00:00:00 2001 From: Initial-heart <63091661+Initial-heart-1@users.noreply.github.com> Date: Mon, 12 Jun 2023 08:02:11 +0800 Subject: [PATCH 2/5] fix: str to int --- src/Ray.BiliBiliTool.Console/appsettings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ray.BiliBiliTool.Console/appsettings.json b/src/Ray.BiliBiliTool.Console/appsettings.json index ddcba8713..1e1284750 100644 --- a/src/Ray.BiliBiliTool.Console/appsettings.json +++ b/src/Ray.BiliBiliTool.Console/appsettings.json @@ -16,8 +16,8 @@ "DayOfReceiveVipPrivilege": 1, //每月几号自动领取会员权益的[-1,31],-1表示不指定,默认每月1号;0表示不自动领取 "DayOfExchangeSilver2Coin": 0, //每月几号执行银瓜子兑换硬币[-1,31],-1表示不指定,默认每月最后一天;-2表示每天;0表示不进行兑换 "DevicePlatform": "android", //执行客户端操作时的平台 [ios,android] - "CustomComicId": "27355", //自定义漫画阅读 comic_id,若不清楚含义请勿修改 - "CustomEpId": "381662" //自定义漫画阅读 ep_id,若不清楚含义请勿修改 + "CustomComicId": 27355, //自定义漫画阅读 comic_id,若不清楚含义请勿修改 + "CustomEpId": 381662 //自定义漫画阅读 ep_id,若不清楚含义请勿修改 }, "LiveLotteryTaskConfig": { From 9ee1753db9dbb0ace6498fe87d95419f5056a23e Mon Sep 17 00:00:00 2001 From: Initial-heart <63091661+Initial-heart-1@users.noreply.github.com> Date: Mon, 12 Jun 2023 12:23:39 +0800 Subject: [PATCH 3/5] fix: avoid possible value overflows --- src/Ray.BiliBiliTool.Config/Options/DailyTaskOptions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ray.BiliBiliTool.Config/Options/DailyTaskOptions.cs b/src/Ray.BiliBiliTool.Config/Options/DailyTaskOptions.cs index 808301b88..127136e41 100644 --- a/src/Ray.BiliBiliTool.Config/Options/DailyTaskOptions.cs +++ b/src/Ray.BiliBiliTool.Config/Options/DailyTaskOptions.cs @@ -80,12 +80,12 @@ public string ChargeComment /// /// 自定义漫画阅读 comic_id /// - public int CustomComicId { get; set; } = 27355; + public long CustomComicId { get; set; } = 27355; /// /// 自定义漫画阅读 ep_id /// - public int CustomEpId { get; set; } = 381662; + public long CustomEpId { get; set; } = 381662; public List SupportUpIdList { From d339c8f117e6c3e8128693508a2870190269b9e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9C=A87=E6=A5=BC?= <31154238+RayWangQvQ@users.noreply.github.com> Date: Sun, 18 Jun 2023 23:36:00 +0800 Subject: [PATCH 4/5] Update src/Ray.BiliBiliTool.DomainService/MangaDomainService.cs --- src/Ray.BiliBiliTool.DomainService/MangaDomainService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Ray.BiliBiliTool.DomainService/MangaDomainService.cs b/src/Ray.BiliBiliTool.DomainService/MangaDomainService.cs index d803fba94..7d175a108 100644 --- a/src/Ray.BiliBiliTool.DomainService/MangaDomainService.cs +++ b/src/Ray.BiliBiliTool.DomainService/MangaDomainService.cs @@ -62,6 +62,7 @@ public async Task MangaSign() /// public async Task MangaRead() { + if ( _dailyTaskOptions.CustomComicId <= 0 ) return; BiliApiResponse response = await _mangaApi.ReadManga(_dailyTaskOptions.DevicePlatform, _dailyTaskOptions.CustomComicId, _dailyTaskOptions.CustomEpId); if (response.Code == 0) From b0226c2257a9d59e077c3610a8d566cf47ef606c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9C=A87=E6=A5=BC?= <31154238+RayWangQvQ@users.noreply.github.com> Date: Sun, 18 Jun 2023 23:59:05 +0800 Subject: [PATCH 5/5] Update src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Interfaces/IMangaApi.cs --- .../BiliBiliAgent/Interfaces/IMangaApi.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Interfaces/IMangaApi.cs b/src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Interfaces/IMangaApi.cs index 3662e57a9..7a851b2de 100644 --- a/src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Interfaces/IMangaApi.cs +++ b/src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Interfaces/IMangaApi.cs @@ -27,7 +27,7 @@ public interface IMangaApi : IBiliBiliApi /// /// [HttpPost("/twirp/bookshelf.v1.Bookshelf/AddHistory?platform={platform}&comic_id={comic_id}&ep_id={ep_id}")] - Task ReadManga(string platform, int comic_id, int ep_id); + Task ReadManga(string platform, long comic_id, long ep_id); /// /// 获取会员漫画奖励