diff --git a/c#/crawler/src/Tieba/Crawl/Crawler/ReplyCrawler.cs b/c#/crawler/src/Tieba/Crawl/Crawler/ReplyCrawler.cs index 6c503d0d..79e62fcc 100644 --- a/c#/crawler/src/Tieba/Crawl/Crawler/ReplyCrawler.cs +++ b/c#/crawler/src/Tieba/Crawl/Crawler/ReplyCrawler.cs @@ -19,7 +19,7 @@ public override Exception FillExceptionData(Exception e) protected override int GetResponseErrorCode(ReplyResponse response) => response.Error.Errorno; public override TbClient.Page GetResponsePage(ReplyResponse response) => response.Data.Page; - protected override async Task> GetRequestsForPage(Page page) + protected override Task> GetRequestsForPage(Page page) { const string url = "c/f/pb/page?cmd=302001"; const string clientVersion = "12.26.1.0"; @@ -29,24 +29,11 @@ protected override async Task> GetRequestsForPage(Page page Pn = (int)page, Rn = 30 }; - var response = await Requester.RequestProtoBuf(url, clientVersion, + var response = Requester.RequestProtoBuf(url, clientVersion, new ReplyRequest {Data = data}, (req, common) => req.Data.Common = common, () => new ReplyResponse()); - var ret = new List(2) {new(Task.FromResult(response))}; - // as of client version 12.12.1.0 (not including), folded replies won't be include in response: - // https://github.com/n0099/TiebaMonitor/commit/b8e7d2645e456271f52457f56500aaedaf28a010#diff-cf67f7f9e82d44aa5be8f85cd24946e5bb7829ca7940c9d056bb1e3849b8f981R32 - // so we have to manually requesting the folded replies by appending the returned request tasks - if (response.Data.HasFoldComment != 0) - { - var dataShowOnlyFolded = data.Clone(); - dataShowOnlyFolded.IsFoldCommentReq = 1; - ret.Add(new(Requester.RequestProtoBuf(url, clientVersion, - new ReplyRequest {Data = dataShowOnlyFolded}, - (req, common) => req.Data.Common = common, - () => new ReplyResponse()), CrawlRequestFlag.ReplyShowOnlyFolded)); - } - return ret; + return Task.FromResult(new[] {new Request(response)}.AsEnumerable()); } public override IList GetValidPosts(ReplyResponse response, CrawlRequestFlag flag) diff --git a/tbclient.protobuf b/tbclient.protobuf index b4941a83..5d664042 160000 --- a/tbclient.protobuf +++ b/tbclient.protobuf @@ -1 +1 @@ -Subproject commit b4941a838f4603b26932f41a6a4c96343242557d +Subproject commit 5d66404202f8f268b27c7e8d44890d39393bf7fa