public string GetGalleryImageUrl(HtmlNode mainDivElement, GalleryParameterValues values)
        {
            if (values?.Get(this.Original, false) == true)
            {
                var    subDivElement = mainDivElement.ChildNodes.FirstOrDefault(n => n.GetAttributeValue("id", string.Empty).Equals("i7"));
                string url2          = HttpUtility.HtmlDecode(subDivElement?.ChildNodes["a"]?.GetAttributeValue("href", null));

                if (url2 == null)
                {
                    return(null);
                }

                var parameter2 = this.CreateRequestParameter();
                parameter2.Uri    = url2;
                parameter2.Method = "GET";

                using (var response2 = this.Explorer.Request(parameter2))
                {
                    return(response2.Headers["Location"]);
                }
            }
            else
            {
                var subDivElement = mainDivElement.ChildNodes.FirstOrDefault(n => n.GetAttributeValue("id", string.Empty).Equals("i3"));
                return(HttpUtility.HtmlDecode(subDivElement?.ChildNodes["a"]?.ChildNodes["img"]?.GetAttributeValue("src", null)));
            }
        }
示例#2
0
        public override List <GalleryImageView> GetGalleryImageViews(GalleryParameterValues values)
        {
            this.InstallLtn();
            var json = this.GetGalleryInfoAsJson();

            return(this.GetGalleryImageFiles(json).Select(token => this.GetGalleryImageView(token)).ToList());
        }
示例#3
0
 public override GalleryImagePath GetGalleryImagePath(GalleryImageView view, GalleryParameterValues values)
 {
     return(new GalleryImagePath()
     {
         ImageUrl = view.Url
     });
 }
        public override List <GalleryImageView> GetGalleryImageViews(GalleryParameterValues values)
        {
            var galleryUrl = this.GalleryUrl;
            int pageCount  = this.GetGalleryPageCount(galleryUrl);
            var list       = new List <GalleryImageView>();

            for (int i = 0; i < pageCount; i++)
            {
                list.AddRange(this.GetGalleryImageViews(galleryUrl, i));
            }

            return(list);
        }
        private GalleryImagePath GetGalleryImagePath(string viewUrl, GalleryParameterValues values)
        {
            var parameter = this.CreateRequestParameter();

            parameter.Uri    = viewUrl;
            parameter.Method = "GET";

            using (var response = this.Explorer.Request(parameter))
            {
                var bodyElement    = response.ReadAsDocument().DocumentNode.ChildNodes["html"].ChildNodes["body"];
                var mainDivElement = bodyElement.ChildNodes.FirstOrDefault(n => n.GetAttributeValue("id", string.Empty).Equals("i1"));

                var image = new GalleryImagePath
                {
                    ImageUrl  = this.GetGalleryImageUrl(mainDivElement, values),
                    ReloadUrl = this.GetGalleryReloadUrl(viewUrl, mainDivElement)
                };

                return(image);
            }
        }
示例#6
0
        public override WebRequestParameter CreateImageRequest(GalleryImageView view, GalleryImagePath path, GalleryParameterValues values)
        {
            var request = base.CreateImageRequest(view, path, values);

            request.Referer = Site.HitomiReader.ToUrl(this.DownloadInput);

            return(request);
        }
示例#7
0
 public override GalleryImagePath ReloadImagePath(GalleryImageView _view, GalleryImagePath prev, GalleryParameterValues values)
 {
     if (_view is HitomiGalleryImageView view)
     {
         this.InstallLtn();
         var newView = this.GetGalleryImageView(view.ImageFile);
         return(this.GetGalleryImagePath(newView, values));
     }
     else
     {
         throw new NotImplementedException();
     }
 }
示例#8
0
 public virtual void Validate(GalleryImageView view, GalleryImagePath path, GalleryParameterValues values, byte[] bytes)
 {
 }
示例#9
0
 public abstract GalleryImagePath ReloadImagePath(GalleryImageView view, GalleryImagePath prev, GalleryParameterValues values);
示例#10
0
        public virtual WebRequestParameter CreateImageRequest(GalleryImageView view, GalleryImagePath path, GalleryParameterValues values)
        {
            var parameter = this.CreateRequestParameter();

            parameter.Method = "GET";
            parameter.Uri    = path.ImageUrl;

            return(parameter);
        }
示例#11
0
 public abstract GalleryImagePath GetGalleryImagePath(GalleryImageView view, GalleryParameterValues values);
示例#12
0
 public abstract List <GalleryImageView> GetGalleryImageViews(GalleryParameterValues values);
        public override WebRequestParameter CreateImageRequest(GalleryImageView view, GalleryImagePath path, GalleryParameterValues values)
        {
            var uri      = new Uri(path.ImageUrl);
            var fileName = uri.GetFileName();

            if (fileName.Equals("509.gif") == true)
            {
                throw new ImageRequestCreateException("ImageLimit");
            }

            return(base.CreateImageRequest(view, path, values));
        }
 public override GalleryImagePath ReloadImagePath(GalleryImageView view, GalleryImagePath prev, GalleryParameterValues values)
 {
     return(this.GetGalleryImagePath(prev.ReloadUrl, values));
 }
 public override GalleryImagePath GetGalleryImagePath(GalleryImageView view, GalleryParameterValues values)
 {
     return(this.GetGalleryImagePath(view.Url, values));
 }