Exemple #1
0
        public string GetArchiveLink(GalleryInfo info)
        {
            IAsyncResult asyncResult = this.BeginGetArchiveLink(info, null);

            asyncResult.AsyncWaitHandle.WaitOne();
            return(this.EndGetArchiveLink(asyncResult));
        }
Exemple #2
0
        public IAsyncResult BeginGetArchiveLink(GalleryInfo info, AsyncCallback callBack, object userState)
        {
            if (info.ArchiverKeyTime < DateTime.UtcNow)
            {
                throw new Exception("Archiver Key Time is expired.");
            }

            string url = String.Format(
                "http://exhentai.org/archiver.php?gid={0}&token={1}&or={2}",
                info.token.gid,
                info.token.token,
                info.ArchiverKey);

            HttpWebRequest wReq = WebRequest.Create(url) as HttpWebRequest;

            wReq.Proxy  = this.Proxy;
            wReq.Method = "POST";
            wReq.Headers.Set("cookie", this.m_cookie);
            wReq.Referer     = url;
            wReq.ContentType = "application/x-www-form-urlencoded";

            return(new ApiResult(wReq, ArchiveLinkData, ExHentai.KeyArchiveLink, callBack, userState));
        }
Exemple #3
0
 public string GetArchiveLink(GalleryInfo info)
 {
     IAsyncResult asyncResult = this.BeginGetArchiveLink(info, null);
     asyncResult.AsyncWaitHandle.WaitOne();
     return this.EndGetArchiveLink(asyncResult);
 }
Exemple #4
0
        public IAsyncResult BeginGetArchiveLink(GalleryInfo info, AsyncCallback callBack, object userState)
        {
            if (info.ArchiverKeyTime < DateTime.UtcNow)
                throw new Exception("Archiver Key Time is expired.");

            string url = String.Format(
                        "http://exhentai.org/archiver.php?gid={0}&token={1}&or={2}",
                        info.token.gid,
                        info.token.token,
                        info.ArchiverKey);

            HttpWebRequest wReq = WebRequest.Create(url) as HttpWebRequest;
            wReq.Proxy = this.Proxy;
            wReq.Method = "POST";
            wReq.Headers.Set("cookie", this.m_cookie);
            wReq.Referer = url;
            wReq.ContentType = "application/x-www-form-urlencoded";

            return new ApiResult(wReq, ArchiveLinkData, ExHentai.KeyArchiveLink, callBack, userState);
        }
Exemple #5
0
 public IAsyncResult BeginGetArchiveLink(GalleryInfo info, AsyncCallback callBack)
 {
     return this.BeginGetArchiveLink(info, callBack, null);
 }
Exemple #6
0
 public IAsyncResult BeginGetArchiveLink(GalleryInfo info, AsyncCallback callBack)
 {
     return(this.BeginGetArchiveLink(info, callBack, null));
 }