예제 #1
0
        public virtual bool IsAcceptable(DownloadInput input)
        {
            if (this.RequireKey == true)
            {
                return(input.Key != null);
            }

            return(true);
        }
예제 #2
0
        public string SelectDownloadInput(DownloadInput input)
        {
            var builder = new StringBuilder();

            builder.Append(input.Number);

            if (this.RequireKey == true)
            {
                builder.Append(DownloadInput.KeyDelimiter);
                builder.Append(input.Key);
            }

            return(builder.ToString());
        }
예제 #3
0
        public string ToUrl(DownloadInput input)
        {
            var list = new List <string>()
            {
                this.Prefix, this.SelectDownloadInput(input), this.Suffix
            };
            var builder = new StringBuilder();

            foreach (var str in list)
            {
                if (str != null)
                {
                    builder.Append(str);
                }
            }

            return(builder.ToString());
        }
예제 #4
0
        public HitomiAgent(Site site, DownloadInput downloadInput, WebRequestProvider webRequestProvider) : base(site, downloadInput, webRequestProvider)
        {
            var engine = this.JintEngine = new Engine();

            engine.Execute("var document = {};");
            engine.Execute("document.body = {};");
            engine.Execute("document.body.appendChild = function(){};");
            engine.Execute("document.location = {};");
            engine.Execute("document.location.hostname = '';");
            engine.Execute("document.createElement = function(){ return {}; };");
            engine.Execute("document.ready = function(func){ return func(); };");
            engine.Execute("document.mouseenter = function(func){ return document; };");
            engine.Execute("document.mouseleave = function(func){ return document; };");
            engine.Execute("document.click = function(func){ return document; };");
            engine.Execute("document.each = function(func){ return document; };");
            engine.Execute("var $ = function(data){ return document; };");
            engine.SetValue("ajax", new Action <object>(ExecuteAJax));
            engine.Execute("setTimeout = function(){};");
            engine.Execute("HTMLImageElement = function(){};");
        }
        public override GalleryAgent CreateAgent(DownloadInput downloadInput, WebRequestProvider webRequestProvider)
        {
            var account = DoujinshiDownloader.Instance.Config.Values.Agent.ExHentaiAccount;

            return(new ExHentaiAgent(this.Site, downloadInput, webRequestProvider, account));
        }
예제 #6
0
 public override GalleryAgent CreateAgent(DownloadInput downloadInput, WebRequestProvider webRequestProvider)
 {
     return(new ExHentaiAgent(this.Site, downloadInput, webRequestProvider, null));
 }
예제 #7
0
 public abstract GalleryAgent CreateAgent(DownloadInput downloadInput, WebRequestProvider webRequestProvider);
예제 #8
0
 public GalleryAgent(Site site, DownloadInput downloadInput, WebRequestProvider webRequestProvider)
 {
     this.Site               = site;
     this.DownloadInput      = downloadInput;
     this.WebRequestProvider = webRequestProvider;
 }
 public ExHentaiAgent(Site site, DownloadInput downloadInput, WebRequestProvider webRequestProvider, ExHentaiAccount account) : base(site, downloadInput, webRequestProvider)
 {
     this.Account = account != null ? new ExHentaiAccount(account) : null;
 }