예제 #1
0
        protected override async Task <GetChaptersResponse> GetChaptersAsync(GetChaptersRequest request)
        {
            var r       = new GetChaptersResponse();
            var keyList = request.ChapterKeys.ToArray();

            for (var i = 0; i < keyList.Length; i++)
            {
                var ck = keyList[i];
                if (ck.StartsWith("n"))
                {
                    var pck  = ck.Substring(1);
                    var pdoc = await GetDoc(new Uri($"read/{request.BookKey}/{pck}.html", UriKind.Relative));

                    ck = await parseChapterPageAsync(new ChapterDataDetailed(), pdoc);
                }
                var doc = await GetDoc(new Uri($"read/{request.BookKey}/{ck}.html", UriKind.Relative));

                var cc = new ChapterDataDetailed();
                var nk = await parseChapterPageAsync(cc, doc);

                if (i + 1 < keyList.Length && keyList[i + 1].Substring(1) == ck)
                {
                    keyList[i + 1] = nk;
                }
                r.Chapters.Add(cc);
            }
            return(r);
        }
예제 #2
0
        protected override async Task <GetChaptersResponse> GetChaptersAsync(GetChaptersRequest request)
        {
            var r       = new GetChaptersResponse();
            var keyList = request.ChapterKeys.ToArray();

            for (var i = 0; i < keyList.Length; i++)
            {
                var ck  = keyList[i].Split(new[] { ' ' }, 2);
                var doc = await GetDoc(new Uri($"/xiaoshuo/{request.BookKey}/{ck[0]}.html", UriKind.Relative));

                var cc = new ChapterDataDetailed {
                    Key = keyList[i], VolumeTitle = ck[1]
                };
                parseChapterPage(cc, doc);
                r.Chapters.Add(cc);
            }
            return(r);
        }
 protected override Task <GetChaptersResponse> GetChaptersAsync(GetChaptersRequest request) => throw new NotImplementedException();
예제 #4
0
 protected abstract Task <GetChaptersResponse> GetChaptersAsync(GetChaptersRequest request);