Example #1
0
        /// <summary>
        /// 下载第一张图片
        /// </summary>
        public static async Task DownloadFirstImage(this IllustDetail illust)
        {
            DownloadJobsAdd?.Invoke(illust.Title);
            var file = await illust.GetDownloadTargetFile(0);

            if (file != null)
            {
                NewJob(illust.Title, illust.OriginalUrls[0], file);
            }
        }
Example #2
0
        /// <summary>
        /// 下载动图
        /// </summary>
        public static async Task DownloadUgoiraImage(this IllustDetail illust)
        {
            DownloadJobsAdd?.Invoke(illust.Title);
            var file = await illust.GetDownloadTargetFile(0);

            var res    = await new PixivCS.PixivAppAPI(OverAll.GlobalBaseAPI).GetUgoiraMetadataAsync(illust.IllustID.ToString());
            var zipurl = res.UgoiraMetadataUgoiraMetadata.ZipUrls.Medium?.ToString() ?? string.Empty;

            if (file != null)
            {
                NewUgoiraJob(illust.Title, zipurl, file, res);
            }
        }
Example #3
0
                : illust.DownloadFirstImage();                    // 保存第一张图片

        /// <summary>
        /// 下载全部 分P
        /// </summary>
        public static async Task DownloadAllImage(this IllustDetail illust)
        {
            DownloadJobsAdd?.Invoke(illust.Title);
            for (ushort i = 0; i < illust.OriginalUrls.Count; i++)
            {
                var file = await illust.GetDownloadTargetFile(i);

                if (file != null)
                {
                    NewJob(illust.Title, illust.OriginalUrls[i], file);
                }
            }
        }