// 这里我不写泛型是因为有的东西(如推荐) 一直翻页会瞬间爆炸 public static async Task <Illust[]> GetAllIllusts(this PixivClient client, IllustsPage page) { var result = new List <Illust>(page.Illusts); var currentPage = page; var count = 0; while (currentPage.NextUrl != null) { var fetchedPage = await client.GetNextPageAsync(currentPage); result.AddRange(fetchedPage.Illusts); currentPage = fetchedPage; Trace.WriteLine($"fetched page: {++count*30}"); } return(result.ToArray()); }
public static Task <Illust[]> GetAllIllusts(this IllustsPage page) { return(PixivClient.GlobalClient.GetAllIllusts(page)); }