private void callback(string html) { if (html.Contains("识别码搜寻结果")) { //<div class="video" id="vid_javlio354y"><a href="./?v=javlio354y" title="ABP-001 水咲ローラがご奉仕しちゃう超最新やみつきエステ"><div class="id">ABP-001</div> //http://www.javlibrary.com/cn/?v=javlio354y Regex regVideo = new Regex("<div class=\"video\".*" + video.Code + "</div>"); var videoItem = regVideo.Match(html); if (!string.IsNullOrEmpty(videoItem.Value)) { // 这是从javlibrary上搜到了不止一个影片信息,那就取第一个信息 var m = new Regex("<a href=.* title=").Match(videoItem.Value); var t = m.Value.Replace("\"", "").Replace("<a href=./", "").Replace(" title=", ""); HTMLHelper.GetInstance().GetHtml(string.Format("http://www.javlibrary.com/cn/{0}", t), this.callback); } else { //javlibrary找不到影片信息上找不到,那就到javmoo上去找 //HTMLHelper.GetInstance().GetHtml(string.Format("http://www.javmoo.xyz/cn/search/{0}", video.Code), this.callbackOnJav); //MessageBox.Show("找不到相关信息"); //javlibrary找不到影片信息上找不到,那就到javbus上去找 HTMLHelper.GetInstance().GetHtml(string.Format("https://www.javbus.me/{0}", video.Code), this.callbackOnJav); } } else { // 从javlibrary上找到了信息 VideoManager.GetInstance().CreateVideo(html, Video.Code, Video); this.onCreateVideo(); } }
private void OnSearchVideoInfo(object sender, RoutedEventArgs e) { code = this.codeTextBox.Text.ToUpper(); if (Regex.IsMatch(code, @"[A-Z]+-[0-9]+")) { HTMLHelper.GetInstance().GetHtml(string.Format("http://www.javlibrary.com/cn/vl_searchbyid.php?keyword={0}", code), this.callback); } else { MessageBox.Show(string.Format("番号:{0}格式有误", code)); } }
private void callback(string html) { if (html.Contains("识别码搜寻结果")) { //<div class="video" id="vid_javlio354y"><a href="./?v=javlio354y" title="ABP-001 水咲ローラがご奉仕しちゃう超最新やみつきエステ"><div class="id">ABP-001</div> //http://www.javlibrary.com/cn/?v=javlio354y Regex regVideo = new Regex("<div class=\"video\".*" + code + "</div>"); var videoItem = regVideo.Match(html); if (!string.IsNullOrEmpty(videoItem.Value)) { var m = new Regex("<a href=.* title=").Match(videoItem.Value); var t = m.Value.Replace("\"", "").Replace("<a href=./", "").Replace(" title=", ""); HTMLHelper.GetInstance().GetHtml(string.Format("http://www.javlibrary.com/cn/{0}", t), this.callback); } else { MessageBox.Show("找不到影片信息:" + code); } } else { CurrentVideo = VideoManager.GetInstance().CreateVideo(html, code); if (RegularHelper.IsUrl(CurrentVideo.ImgUrl)) { this.coverImg.Dispatcher.Invoke(new Action(delegate { this.coverImg.Source = new BitmapImage(new Uri(CurrentVideo.ImgUrl)); })); } else { Logger.Error(string.Format("{0}的封面地址有误:{1}", CurrentVideo.Code, CurrentVideo.ImgUrl)); } this.nameTextBox.Dispatcher.Invoke(new Action(delegate { this.nameTextBox.Text = CurrentVideo.Name; })); this.birthdayTextBox.Dispatcher.Invoke(new Action(delegate { this.birthdayTextBox.Text = CurrentVideo.Date.ToString("yyyy-MM-dd"); })); this.classTypeTextBox.Dispatcher.Invoke(new Action(delegate { this.classTypeTextBox.Text = CurrentVideo.GetClassString(); })); this.actressTextBox.Dispatcher.Invoke(new Action(delegate { this.actressTextBox.Text = CurrentVideo.GetActressString(); })); } }
private void OnUpdateVideo(object sender, RoutedEventArgs e) { HTMLHelper.GetInstance().GetHtml(string.Format("http://www.javlibrary.com/cn/vl_searchbyid.php?keyword={0}", video.Code), this.callback); }
private void button5_Click(object sender, RoutedEventArgs e) { //ImageHelper.DoGetImage("http://n.sinaimg.cn/transform/20150914/-ybr-fxhupir7102739.jpg", "ttttt.jpg"); HTMLHelper.GetInstance().GetHtml("http://www.javmoo.xyz/cn/search/AIR-004", this.callbackOnJav); }