public virtual bool IsAcceptable(DownloadInput input) { if (this.RequireKey == true) { return(input.Key != null); } return(true); }
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()); }
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()); }
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)); }
public override GalleryAgent CreateAgent(DownloadInput downloadInput, WebRequestProvider webRequestProvider) { return(new ExHentaiAgent(this.Site, downloadInput, webRequestProvider, null)); }
public abstract GalleryAgent CreateAgent(DownloadInput downloadInput, WebRequestProvider webRequestProvider);
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; }