コード例 #1
0
ファイル: ExHentai.cs プロジェクト: bonbon197/ExHentaiAPI
        public TorrentInfoCollection GetTorrentInfo(GalleryToken token)
        {
            IAsyncResult asyncResult = this.BeginGetTorrentInfo(token, null);

            asyncResult.AsyncWaitHandle.WaitOne();
            return(this.EndGetTorrentInfo(asyncResult));
        }
コード例 #2
0
ファイル: GalleryToken.cs プロジェクト: RyuaNerin/ExHentaiAPI
        public bool Equals(GalleryToken obj)
        {
            if ((object)obj == null)
                return false;

            return (this.gid == obj.gid) && (this.token == obj.token);
        }
コード例 #3
0
ファイル: ExHentai.cs プロジェクト: bonbon197/ExHentaiAPI
        public TorrentInfoCollection EndGetTorrentInfo(IAsyncResult asyncResult)
        {
            ApiResult aRes = asyncResult as ApiResult;

            if (aRes == null || aRes.m_parentId != ExHentai.KeyTorrentInfo)
            {
                throw new FormatException();
            }

            if (aRes.m_exception != null)
            {
                throw aRes.m_exception;
            }

            aRes.CompletedSynchronously = true;

            GalleryToken token = aRes.m_userState as GalleryToken;

            if (token == null)
            {
                return(new TorrentInfoCollection(aRes.m_body));
            }
            else
            {
                return(new TorrentInfoCollection(aRes.m_body, token));
            }
        }
コード例 #4
0
        public bool Equals(GalleryToken obj)
        {
            if ((object)obj == null)
            {
                return(false);
            }

            return((this.gid == obj.gid) && (this.token == obj.token));
        }
コード例 #5
0
ファイル: ExHentai.cs プロジェクト: bonbon197/ExHentaiAPI
        public IAsyncResult BeginGetTorrentInfo(GalleryToken token, AsyncCallback callBack, object userState)
        {
            WebRequest wReq = WebRequest.Create(String.Format("http://exhentai.org/gallerytorrents.php?gid={0}&t={1}", token.gid, token.token));

            wReq.Proxy  = this.Proxy;
            wReq.Method = "GET";
            wReq.Headers.Set("cookie", this.m_cookie);

            return(new ApiResult(wReq, ExHentai.KeyTorrentInfo, callBack, userState));
        }
コード例 #6
0
        internal TorrentInfo(string body, GalleryToken token)
        {
            this.Token = token;

            this.gtid = int.Parse(rGtid.Match(body).Groups[1].Value);

            this.PostedUTC = DateTime.Parse(rPosted.Match(body).Groups[1].Value);
            this.Posted    = this.PostedUTC.ToLocalTime();
            this.Size      = parseSize(rSize.Match(body).Groups[1].Value.Trim());
            this.Seeds     = int.Parse(rSeeds.Match(body).Groups[1].Value.Trim());
            this.Peers     = int.Parse(rPeers.Match(body).Groups[1].Value.Trim());
            this.Downloads = int.Parse(rDownload.Match(body).Groups[1].Value.Trim());
            this.Uploader  = rUPloader.Match(body).Groups[1].Value.Trim();
            this.FileName  = rName.Match(body).Groups[1].Value.Trim();
        }
コード例 #7
0
        internal TorrentInfoCollection(string body, GalleryToken token)
        {
            this.ShowingStart = this.ShowingEnd = this.SearchCount = 0;

            string[] arr = rForm.Split(body);
            for (int i = 0; i < arr.Length; ++i)
            {
                try
                {
                    this.Add(new TorrentInfo(arr[i], token));
                }
                catch
                {
                }
            }
        }
コード例 #8
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            GalleryToken p = obj as GalleryToken;

            if ((Object)p == null)
            {
                return(false);
            }

            return((this.gid == p.gid) && (this.token == p.token));
        }
コード例 #9
0
ファイル: ExHentai.cs プロジェクト: RyuaNerin/ExHentaiAPI
        public IAsyncResult BeginGetTorrentInfo(GalleryToken token, AsyncCallback callBack, object userState)
        {
            WebRequest wReq = WebRequest.Create(String.Format("http://exhentai.org/gallerytorrents.php?gid={0}&t={1}", token.gid, token.token));
            wReq.Proxy = this.Proxy;
            wReq.Method = "GET";
            wReq.Headers.Set("cookie", this.m_cookie);

            return new ApiResult(wReq, ExHentai.KeyTorrentInfo, callBack, userState);
        }
コード例 #10
0
ファイル: ExHentai.cs プロジェクト: RyuaNerin/ExHentaiAPI
 public TorrentInfoCollection GetTorrentInfo(GalleryToken token)
 {
     IAsyncResult asyncResult = this.BeginGetTorrentInfo(token, null);
     asyncResult.AsyncWaitHandle.WaitOne();
     return this.EndGetTorrentInfo(asyncResult);
 }
コード例 #11
0
ファイル: ExHentai.cs プロジェクト: RyuaNerin/ExHentaiAPI
 public IAsyncResult BeginGetGalleryInfo(GalleryToken token, AsyncCallback callBack, object userState)
 {
     return this.BeginGetGalleryInfo(token.ToByteArray(), callBack, userState);
 }
コード例 #12
0
ファイル: ExHentai.cs プロジェクト: RyuaNerin/ExHentaiAPI
 public IAsyncResult BeginGetTorrentInfo(GalleryToken token, AsyncCallback callBack)
 {
     return this.BeginGetTorrentInfo(token, callBack, null);
 }
コード例 #13
0
ファイル: ExHentai.cs プロジェクト: RyuaNerin/ExHentaiAPI
 public IAsyncResult BeginGetGalleryInfo(GalleryToken token, AsyncCallback callBack)
 {
     return this.BeginGetGalleryInfo(token.ToByteArray(), callBack, null);
 }
コード例 #14
0
ファイル: ExHentai.cs プロジェクト: bonbon197/ExHentaiAPI
 public IAsyncResult BeginGetGalleryInfo(GalleryToken token, AsyncCallback callBack)
 {
     return(this.BeginGetGalleryInfo(token.ToByteArray(), callBack, null));
 }
コード例 #15
0
ファイル: TorrentInfo.cs プロジェクト: RyuaNerin/ExHentaiAPI
        internal TorrentInfo(string body, GalleryToken token)
        {
            this.Token = token;

            this.gtid = int.Parse(rGtid.Match(body).Groups[1].Value);

            this.PostedUTC	= DateTime.Parse(rPosted.Match(body).Groups[1].Value);
            this.Posted		= this.PostedUTC.ToLocalTime();
            this.Size		= parseSize(rSize.Match(body).Groups[1].Value.Trim());
            this.Seeds		= int.Parse(rSeeds.Match(body).Groups[1].Value.Trim());
            this.Peers		= int.Parse(rPeers.Match(body).Groups[1].Value.Trim());
            this.Downloads	= int.Parse(rDownload.Match(body).Groups[1].Value.Trim());
            this.Uploader	= rUPloader.Match(body).Groups[1].Value.Trim();
            this.FileName	= rName.Match(body).Groups[1].Value.Trim();
        }
コード例 #16
0
ファイル: ExHentai.cs プロジェクト: bonbon197/ExHentaiAPI
 public IAsyncResult BeginGetGalleryInfo(GalleryToken token, AsyncCallback callBack, object userState)
 {
     return(this.BeginGetGalleryInfo(token.ToByteArray(), callBack, userState));
 }
コード例 #17
0
ファイル: ExHentai.cs プロジェクト: bonbon197/ExHentaiAPI
 public IAsyncResult BeginGetTorrentInfo(GalleryToken token, AsyncCallback callBack)
 {
     return(this.BeginGetTorrentInfo(token, callBack, null));
 }