Prechádzať zdrojové kódy

fix! make it work again.

unknown 9 rokov pred
rodič
commit
a03722e012

+ 6 - 5
Arzon/Arzon.cs

@@ -80,12 +80,13 @@ namespace Gets
             for (int i = 0; i < cou; i++)
             {
 
-                string n_title = doc.DocumentNode.SelectNodes("//div[@id='itemd']")[i].ChildNodes["ul"].ChildNodes["li"].ChildNodes["h3"].InnerText;
+                string n_title = doc.DocumentNode.SelectNodes("//div[@id='itemd']//h2/a")[i].InnerText;
                 n_title = Tools.RemoveInvalidChars(n_title);
 
-                string n_itemURL = "http://" + u.Host + doc.DocumentNode.SelectNodes("//div[@id='itemd']")[i].ChildNodes["ul"].ChildNodes["li"].ChildNodes["h3"].ChildNodes["a"].Attributes["href"].Value;
+                string n_itemURL = "http://" + u.Host + doc.DocumentNode.SelectNodes("//div[@id='itemd']//h2/a")[i].Attributes["href"].Value;
 
-                string n_date = doc.DocumentNode.SelectSingleNode("//div[@id='itemd']/ul/li/span[@class='date']").InnerText;
+                string n_date = doc.DocumentNode.SelectNodes("//div[@id='itemd']//span")[i].InnerText.Trim();
+               
 
                 var datanode = doc.DocumentNode.SelectNodes("//div[@class='data']")[i];
                 HtmlDocument docData = new HtmlDocument();
@@ -232,8 +233,8 @@ namespace Gets
                 var docc = new HtmlDocument();
                 docc.LoadHtml(html);
                 //web DOM Changed 2014/12/7
-                string Title = docc.DocumentNode.SelectSingleNode("//div[@id='detail_new']/div[@class='detail_title_new']/h1").InnerText.Trim();
-                string coverImg = docc.DocumentNode.SelectSingleNode("//*[@id='detail_new']//table//table//a").Attributes["href"].Value.ToString().Trim();
+                string Title = docc.DocumentNode.SelectSingleNode("//div[@id='detail_new']//div[@class='detail_title_new2']//h1").InnerText;
+                string coverImg = docc.DocumentNode.SelectNodes("//div[@id='detail_new']//img[@class='item_img']")[0].Attributes["src"].Value.ToString();
 
 
                 //AV女優:

+ 1 - 0
Arzon/Gets.csproj

@@ -47,6 +47,7 @@
   <ItemGroup>
     <Compile Include="Arzon.cs" />
     <Compile Include="AVEntertainments.cs" />
+    <Compile Include="HttpHelper.cs" />
     <Compile Include="MywebClient.cs">
       <SubType>Component</SubType>
     </Compile>

+ 310 - 0
Arzon/HttpHelper.cs

@@ -0,0 +1,310 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Net;
+using System.IO;
+using System.Threading;
+
+namespace Gets
+{
+    public class HttpHelper
+    {
+        #region 私有变量
+        private CookieContainer cc;
+        private string contentType = "application/x-www-form-urlencoded";
+        private string accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-silverlight, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-silverlight-2-b1, */*";
+        private string userAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)";
+        private Encoding encoding = Encoding.GetEncoding("utf-8");
+        private int delay = 3000;
+        private int maxTry = 3;
+        private int currentTry = 0;
+        #endregion
+
+        #region 属性
+        /// <summary>
+        /// Cookie容器
+        /// </summary>
+        public CookieContainer CookieContainer
+        {
+            get
+            {
+                return cc;
+            }
+        }
+
+        /// <summary>
+        /// 获取网页源码时使用的编码
+        /// </summary>
+        /// <value></value>
+        public Encoding Encoding
+        {
+            get
+            {
+                return encoding;
+            }
+            set
+            {
+                encoding = value;
+            }
+        }
+
+        public int NetworkDelay
+        {
+            get
+            {
+                return delay;
+            }
+            set
+            {
+                delay = value;
+            }
+        }
+
+        public int MaxTry
+        {
+            get
+            {
+                return maxTry;
+            }
+            set
+            {
+                maxTry = value;
+            }
+        }
+        #endregion
+
+        #region 构造函数
+        /// <summary>
+        /// Initializes a new instance of the <see cref="HttpHelper"/> class.
+        /// </summary>
+        public HttpHelper()
+        {
+            cc = new CookieContainer();
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="HttpHelper"/> class.
+        /// </summary>
+        /// <param name="cc">The cc.</param>
+        public HttpHelper(CookieContainer cc)
+        {
+            this.cc = cc;
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="HttpHelper"/> class.
+        /// </summary>
+        /// <param name="contentType">Type of the content.</param>
+        /// <param name="accept">The accept.</param>
+        /// <param name="userAgent">The user agent.</param>
+        public HttpHelper(string contentType, string accept, string userAgent)
+        {
+            this.contentType = contentType;
+            this.accept = accept;
+            this.userAgent = userAgent;
+        }
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="HttpHelper"/> class.
+        /// </summary>
+        /// <param name="cc">The cc.</param>
+        /// <param name="contentType">Type of the content.</param>
+        /// <param name="accept">The accept.</param>
+        /// <param name="userAgent">The user agent.</param>
+        public HttpHelper(CookieContainer cc, string contentType, string accept, string userAgent)
+        {
+            this.cc = cc;
+            this.contentType = contentType;
+            this.accept = accept;
+            this.userAgent = userAgent;
+        }
+        #endregion
+
+        #region 公共方法
+        /// <summary>
+        /// 获取指定页面的HTML代码
+        /// </summary>
+        /// <param name="url">指定页面的路径</param>
+        /// <param name="postData">回发的数据</param>
+        /// <param name="isPost">是否以post方式发送请求</param>
+        /// <param name="cookieCollection">Cookie集合</param>
+        /// <returns></returns>
+        public string GetHtml(string url, string postData, bool isPost, CookieContainer cookieContainer)
+        {
+            if (string.IsNullOrEmpty(postData))
+            {
+                return GetHtml(url, cookieContainer);
+            }
+
+            Thread.Sleep(delay);
+
+            currentTry++;
+
+            try
+            {
+                byte[] byteRequest = Encoding.Default.GetBytes(postData);
+
+                HttpWebRequest httpWebRequest;
+                httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
+                httpWebRequest.CookieContainer = cookieContainer;
+                httpWebRequest.ContentType = contentType;
+                httpWebRequest.Referer = url;
+                httpWebRequest.Accept = accept;
+                httpWebRequest.UserAgent = userAgent;
+                httpWebRequest.Method = isPost ? "POST" : "GET";
+                httpWebRequest.ContentLength = byteRequest.Length;
+
+                Stream stream = httpWebRequest.GetRequestStream();
+                stream.Write(byteRequest, 0, byteRequest.Length);
+                stream.Close();
+
+                HttpWebResponse httpWebResponse;
+                httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
+                Stream responseStream = httpWebResponse.GetResponseStream();
+                StreamReader streamReader = new StreamReader(responseStream, encoding);
+                string html = streamReader.ReadToEnd();
+                streamReader.Close();
+                responseStream.Close();
+
+                currentTry = 0;
+                return html;
+            }
+            catch (Exception e)
+            {
+                Console.ForegroundColor = ConsoleColor.Red;
+                Console.WriteLine(DateTime.Now.ToString("HH:mm:ss ") + e.Message);
+                Console.ForegroundColor = ConsoleColor.White;
+
+                if (currentTry <= maxTry)
+                {
+                    GetHtml(url, postData, isPost, cookieContainer);
+                }
+
+                currentTry = 0;
+                return string.Empty;
+            }
+        }
+
+        /// <summary>
+        /// 获取指定页面的HTML代码
+        /// </summary>
+        /// <param name="url">指定页面的路径</param>
+        /// <param name="cookieCollection">Cookie集合</param>
+        /// <returns></returns>
+        public string GetHtml(string url, CookieContainer cookieContainer)
+        {
+            Thread.Sleep(delay);
+
+            currentTry++;
+
+            try
+            {
+                HttpWebRequest httpWebRequest;
+                httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
+                httpWebRequest.CookieContainer = cookieContainer;
+                httpWebRequest.ContentType = contentType;
+                httpWebRequest.Referer = url;
+                httpWebRequest.Accept = accept;
+                httpWebRequest.UserAgent = userAgent;
+                httpWebRequest.Method = "GET";
+
+                HttpWebResponse httpWebResponse;
+                httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
+                Stream responseStream = httpWebResponse.GetResponseStream();
+                StreamReader streamReader = new StreamReader(responseStream, encoding);
+                string html = streamReader.ReadToEnd();
+                streamReader.Close();
+                responseStream.Close();
+
+                currentTry = 0;
+                return html;
+            }
+            catch (Exception e)
+            {
+                Console.ForegroundColor = ConsoleColor.Red;
+                Console.WriteLine(DateTime.Now.ToString("HH:mm:ss ") + e.Message);
+                Console.ForegroundColor = ConsoleColor.White;
+
+                if (currentTry <= maxTry)
+                {
+                    GetHtml(url, cookieContainer);
+                }
+
+                currentTry = 0;
+                return string.Empty;
+            }
+        }
+
+        /// <summary>
+        /// 获取指定页面的HTML代码
+        /// </summary>
+        /// <param name="url">指定页面的路径</param>
+        /// <returns></returns>
+        public string GetHtml(string url)
+        {
+            return GetHtml(url, cc);
+        }
+
+        /// <summary>
+        /// 获取指定页面的HTML代码
+        /// </summary>
+        /// <param name="url">指定页面的路径</param>
+        /// <param name="postData">回发的数据</param>
+        /// <param name="isPost">是否以post方式发送请求</param>
+        /// <returns></returns>
+        public string GetHtml(string url, string postData, bool isPost)
+        {
+            return GetHtml(url, postData, isPost, cc);
+        }
+
+        /// <summary>
+        /// 获取指定页面的Stream
+        /// </summary>
+        /// <param name="url">指定页面的路径</param>
+        /// <param name="postData">回发的数据</param>
+        /// <param name="isPost">是否以post方式发送请求</param>
+        /// <param name="cookieCollection">Cookie集合</param>
+        /// <returns></returns>
+        public Stream GetStream(string url, CookieContainer cookieContainer)
+        {
+            Thread.Sleep(delay);
+
+            currentTry++;
+
+            try
+            {
+                HttpWebRequest httpWebRequest;
+                httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
+                httpWebRequest.CookieContainer = cookieContainer;
+                httpWebRequest.ContentType = contentType;
+                httpWebRequest.Referer = url;
+                httpWebRequest.Accept = accept;
+                httpWebRequest.UserAgent = userAgent;
+                httpWebRequest.Method = "GET";
+
+                HttpWebResponse httpWebResponse;
+                httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
+                Stream responseStream = httpWebResponse.GetResponseStream();
+                currentTry = 0;
+                return responseStream;
+            }
+            catch (Exception e)
+            {
+                Console.ForegroundColor = ConsoleColor.Red;
+                Console.WriteLine(DateTime.Now.ToString("HH:mm:ss ") + e.Message);
+                Console.ForegroundColor = ConsoleColor.White;
+
+                if (currentTry <= maxTry)
+                {
+                    GetHtml(url, cookieContainer);
+                }
+
+                currentTry = 0;
+                return null;
+            }
+        }
+
+        #endregion
+    }
+
+}

+ 1 - 1
Entity/Tools.cs

@@ -11,7 +11,7 @@ namespace AVSORTER
     {
         public static string Fcode(string code)
         {
-            Regex r1 = new Regex(@"(\d{0,1}[a-zA-Z]{2,5})[- _]{0,1}(\d{2,4})");
+            Regex r1 = new Regex(@"(\d{0,1}[a-zA-Z]{2,5})[- _]{0,1}(\d{2,5})");
 
             if (r1.Match(code).Value=="")
 	        {

+ 192 - 30
PicSo/Form1.Designer.cs

@@ -39,6 +39,7 @@
             this.tabPage1 = new System.Windows.Forms.TabPage();
             this.btn_rebuild = new System.Windows.Forms.Button();
             this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.btn_paste_new = new System.Windows.Forms.Button();
             this.btn_AddNewEmptyItem = new System.Windows.Forms.Button();
             this.txt_EmptyItemKeyWord = new System.Windows.Forms.TextBox();
             this.listView1 = new System.Windows.Forms.ListView();
@@ -66,13 +67,26 @@
             this.btn_LocalSearch = new System.Windows.Forms.Button();
             this.txt_LocalSearchKeyWord = new System.Windows.Forms.TextBox();
             this.tabPage3 = new System.Windows.Forms.TabPage();
+            this.label3 = new System.Windows.Forms.Label();
+            this.nud_ActorLessThan = new System.Windows.Forms.NumericUpDown();
             this.txt_FindStatus = new System.Windows.Forms.TextBox();
             this.btnFind = new System.Windows.Forms.Button();
             this.txt_url = new System.Windows.Forms.TextBox();
-            this.nud_ActorLessThan = new System.Windows.Forms.NumericUpDown();
+            this.tabPage4 = new System.Windows.Forms.TabPage();
+            this.btn_p4_Clear = new System.Windows.Forms.Button();
+            this.lv_p4_result = new System.Windows.Forms.ListView();
+            this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.cmenu_p4 = new System.Windows.Forms.ContextMenuStrip(this.components);
+            this.cmenu_p4_item_copy = new System.Windows.Forms.ToolStripMenuItem();
+            this.btn_p4_Go1 = new System.Windows.Forms.Button();
+            this.label4 = new System.Windows.Forms.Label();
+            this.txt_p4_keyword = new System.Windows.Forms.TextBox();
+            this.btn_p4_Go1_paste = new System.Windows.Forms.Button();
             this.bc = new AVSORTER.BasicContainer();
             this.movieContainer1 = new PicSo.MovieContainer();
-            this.label3 = new System.Windows.Forms.Label();
+            this.lbl_p4_status = new System.Windows.Forms.Label();
             this.contextMenuStrip1.SuspendLayout();
             this.tabPage1.SuspendLayout();
             this.groupBox2.SuspendLayout();
@@ -81,6 +95,8 @@
             this.tabPage2.SuspendLayout();
             this.tabPage3.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.nud_ActorLessThan)).BeginInit();
+            this.tabPage4.SuspendLayout();
+            this.cmenu_p4.SuspendLayout();
             this.SuspendLayout();
             // 
             // contextMenuStrip1
@@ -159,6 +175,7 @@
             // 
             // groupBox2
             // 
+            this.groupBox2.Controls.Add(this.btn_paste_new);
             this.groupBox2.Controls.Add(this.btn_AddNewEmptyItem);
             this.groupBox2.Controls.Add(this.txt_EmptyItemKeyWord);
             this.groupBox2.Controls.Add(this.listView1);
@@ -175,13 +192,23 @@
             this.groupBox2.TabStop = false;
             this.groupBox2.Text = "文件列表处理";
             // 
+            // btn_paste_new
+            // 
+            this.btn_paste_new.Location = new System.Drawing.Point(159, 49);
+            this.btn_paste_new.Name = "btn_paste_new";
+            this.btn_paste_new.Size = new System.Drawing.Size(107, 23);
+            this.btn_paste_new.TabIndex = 20;
+            this.btn_paste_new.Text = "粘贴新建";
+            this.btn_paste_new.UseVisualStyleBackColor = true;
+            this.btn_paste_new.Click += new System.EventHandler(this.btn_paste_new_Click);
+            // 
             // btn_AddNewEmptyItem
             // 
-            this.btn_AddNewEmptyItem.Location = new System.Drawing.Point(139, 47);
+            this.btn_AddNewEmptyItem.Location = new System.Drawing.Point(75, 49);
             this.btn_AddNewEmptyItem.Name = "btn_AddNewEmptyItem";
-            this.btn_AddNewEmptyItem.Size = new System.Drawing.Size(127, 23);
+            this.btn_AddNewEmptyItem.Size = new System.Drawing.Size(78, 23);
             this.btn_AddNewEmptyItem.TabIndex = 19;
-            this.btn_AddNewEmptyItem.Text = "新建查询条目";
+            this.btn_AddNewEmptyItem.Text = "新建";
             this.btn_AddNewEmptyItem.UseVisualStyleBackColor = true;
             this.btn_AddNewEmptyItem.Click += new System.EventHandler(this.btn_AddNewEmptyItem_Click);
             // 
@@ -189,7 +216,7 @@
             // 
             this.txt_EmptyItemKeyWord.Location = new System.Drawing.Point(6, 49);
             this.txt_EmptyItemKeyWord.Name = "txt_EmptyItemKeyWord";
-            this.txt_EmptyItemKeyWord.Size = new System.Drawing.Size(127, 21);
+            this.txt_EmptyItemKeyWord.Size = new System.Drawing.Size(63, 21);
             this.txt_EmptyItemKeyWord.TabIndex = 18;
             // 
             // listView1
@@ -382,6 +409,7 @@
             this.tabControl1.Controls.Add(this.tabPage1);
             this.tabControl1.Controls.Add(this.tabPage2);
             this.tabControl1.Controls.Add(this.tabPage3);
+            this.tabControl1.Controls.Add(this.tabPage4);
             this.tabControl1.Location = new System.Drawing.Point(12, 12);
             this.tabControl1.Name = "tabControl1";
             this.tabControl1.SelectedIndex = 0;
@@ -455,45 +483,162 @@
             this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
             this.tabPage3.Size = new System.Drawing.Size(965, 557);
             this.tabPage3.TabIndex = 2;
-            this.tabPage3.Text = "tabPage3";
+            this.tabPage3.Text = "番号提取";
             this.tabPage3.UseVisualStyleBackColor = true;
             // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(87, 43);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(185, 12);
+            this.label3.TabIndex = 4;
+            this.label3.Text = "不统计演员人数超过此数量的影片";
+            // 
+            // nud_ActorLessThan
+            // 
+            this.nud_ActorLessThan.Location = new System.Drawing.Point(278, 38);
+            this.nud_ActorLessThan.Name = "nud_ActorLessThan";
+            this.nud_ActorLessThan.Size = new System.Drawing.Size(48, 21);
+            this.nud_ActorLessThan.TabIndex = 3;
+            this.nud_ActorLessThan.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            // 
             // txt_FindStatus
             // 
-            this.txt_FindStatus.Location = new System.Drawing.Point(6, 62);
+            this.txt_FindStatus.Location = new System.Drawing.Point(6, 67);
             this.txt_FindStatus.Multiline = true;
             this.txt_FindStatus.Name = "txt_FindStatus";
             this.txt_FindStatus.Size = new System.Drawing.Size(953, 187);
             this.txt_FindStatus.TabIndex = 2;
+            this.txt_FindStatus.Text = "粘贴arzon.jp的影片网址列表,要列表模式,不要图片模式";
             // 
             // btnFind
             // 
-            this.btnFind.Location = new System.Drawing.Point(6, 33);
+            this.btnFind.Location = new System.Drawing.Point(6, 38);
             this.btnFind.Name = "btnFind";
             this.btnFind.Size = new System.Drawing.Size(75, 23);
             this.btnFind.TabIndex = 1;
-            this.btnFind.Text = "btn_Find";
+            this.btnFind.Text = "开始";
             this.btnFind.UseVisualStyleBackColor = true;
             this.btnFind.Click += new System.EventHandler(this.btnFind_Click);
             // 
             // txt_url
             // 
-            this.txt_url.Location = new System.Drawing.Point(6, 6);
+            this.txt_url.Location = new System.Drawing.Point(6, 11);
             this.txt_url.Name = "txt_url";
             this.txt_url.Size = new System.Drawing.Size(953, 21);
             this.txt_url.TabIndex = 0;
             // 
-            // nud_ActorLessThan
-            // 
-            this.nud_ActorLessThan.Location = new System.Drawing.Point(278, 33);
-            this.nud_ActorLessThan.Name = "nud_ActorLessThan";
-            this.nud_ActorLessThan.Size = new System.Drawing.Size(48, 21);
-            this.nud_ActorLessThan.TabIndex = 3;
-            this.nud_ActorLessThan.Value = new decimal(new int[] {
-            1,
-            0,
-            0,
-            0});
+            // tabPage4
+            // 
+            this.tabPage4.Controls.Add(this.lbl_p4_status);
+            this.tabPage4.Controls.Add(this.btn_p4_Go1_paste);
+            this.tabPage4.Controls.Add(this.btn_p4_Clear);
+            this.tabPage4.Controls.Add(this.lv_p4_result);
+            this.tabPage4.Controls.Add(this.btn_p4_Go1);
+            this.tabPage4.Controls.Add(this.label4);
+            this.tabPage4.Controls.Add(this.txt_p4_keyword);
+            this.tabPage4.Location = new System.Drawing.Point(4, 22);
+            this.tabPage4.Name = "tabPage4";
+            this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
+            this.tabPage4.Size = new System.Drawing.Size(965, 557);
+            this.tabPage4.TabIndex = 3;
+            this.tabPage4.Text = "下载地址搜索";
+            this.tabPage4.UseVisualStyleBackColor = true;
+            // 
+            // btn_p4_Clear
+            // 
+            this.btn_p4_Clear.Location = new System.Drawing.Point(17, 528);
+            this.btn_p4_Clear.Name = "btn_p4_Clear";
+            this.btn_p4_Clear.Size = new System.Drawing.Size(75, 23);
+            this.btn_p4_Clear.TabIndex = 5;
+            this.btn_p4_Clear.Text = "清空结果";
+            this.btn_p4_Clear.UseVisualStyleBackColor = true;
+            this.btn_p4_Clear.Click += new System.EventHandler(this.btn_p4_Clear_Click);
+            // 
+            // lv_p4_result
+            // 
+            this.lv_p4_result.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader4,
+            this.columnHeader5,
+            this.columnHeader6});
+            this.lv_p4_result.ContextMenuStrip = this.cmenu_p4;
+            this.lv_p4_result.FullRowSelect = true;
+            this.lv_p4_result.Location = new System.Drawing.Point(17, 37);
+            this.lv_p4_result.Name = "lv_p4_result";
+            this.lv_p4_result.Size = new System.Drawing.Size(923, 485);
+            this.lv_p4_result.TabIndex = 4;
+            this.lv_p4_result.UseCompatibleStateImageBehavior = false;
+            this.lv_p4_result.View = System.Windows.Forms.View.Details;
+            // 
+            // columnHeader4
+            // 
+            this.columnHeader4.Text = "名称";
+            this.columnHeader4.Width = 537;
+            // 
+            // columnHeader5
+            // 
+            this.columnHeader5.Text = "大小";
+            this.columnHeader5.Width = 100;
+            // 
+            // columnHeader6
+            // 
+            this.columnHeader6.Text = "链接";
+            this.columnHeader6.Width = 254;
+            // 
+            // cmenu_p4
+            // 
+            this.cmenu_p4.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.cmenu_p4_item_copy});
+            this.cmenu_p4.Name = "cmenu_p4";
+            this.cmenu_p4.Size = new System.Drawing.Size(125, 26);
+            // 
+            // cmenu_p4_item_copy
+            // 
+            this.cmenu_p4_item_copy.Name = "cmenu_p4_item_copy";
+            this.cmenu_p4_item_copy.Size = new System.Drawing.Size(124, 22);
+            this.cmenu_p4_item_copy.Text = "复制地址";
+            this.cmenu_p4_item_copy.Click += new System.EventHandler(this.cmenu_p4_item_copy_Click);
+            // 
+            // btn_p4_Go1
+            // 
+            this.btn_p4_Go1.Location = new System.Drawing.Point(168, 8);
+            this.btn_p4_Go1.Name = "btn_p4_Go1";
+            this.btn_p4_Go1.Size = new System.Drawing.Size(75, 23);
+            this.btn_p4_Go1.TabIndex = 2;
+            this.btn_p4_Go1.Text = "搜索";
+            this.btn_p4_Go1.UseVisualStyleBackColor = true;
+            this.btn_p4_Go1.Click += new System.EventHandler(this.btn_p4_Go1_Click);
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(15, 13);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(41, 12);
+            this.label4.TabIndex = 1;
+            this.label4.Text = "关键字";
+            // 
+            // txt_p4_keyword
+            // 
+            this.txt_p4_keyword.Location = new System.Drawing.Point(62, 10);
+            this.txt_p4_keyword.Name = "txt_p4_keyword";
+            this.txt_p4_keyword.Size = new System.Drawing.Size(100, 21);
+            this.txt_p4_keyword.TabIndex = 0;
+            // 
+            // btn_p4_Go1_paste
+            // 
+            this.btn_p4_Go1_paste.Location = new System.Drawing.Point(249, 8);
+            this.btn_p4_Go1_paste.Name = "btn_p4_Go1_paste";
+            this.btn_p4_Go1_paste.Size = new System.Drawing.Size(75, 23);
+            this.btn_p4_Go1_paste.TabIndex = 6;
+            this.btn_p4_Go1_paste.Text = "粘贴搜索";
+            this.btn_p4_Go1_paste.UseVisualStyleBackColor = true;
+            this.btn_p4_Go1_paste.Click += new System.EventHandler(this.btn_p4_Go1_paste_Click);
             // 
             // bc
             // 
@@ -517,14 +662,15 @@
             this.movieContainer1.Size = new System.Drawing.Size(913, 375);
             this.movieContainer1.TabIndex = 2;
             // 
-            // label3
+            // lbl_p4_status
             // 
-            this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(87, 38);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(185, 12);
-            this.label3.TabIndex = 4;
-            this.label3.Text = "不统计演员人数超过此数量的影片";
+            this.lbl_p4_status.AutoSize = true;
+            this.lbl_p4_status.Location = new System.Drawing.Point(330, 13);
+            this.lbl_p4_status.Name = "lbl_p4_status";
+            this.lbl_p4_status.Size = new System.Drawing.Size(77, 12);
+            this.lbl_p4_status.TabIndex = 7;
+            this.lbl_p4_status.Text = "正在搜索……";
+            this.lbl_p4_status.Visible = false;
             // 
             // Form1
             // 
@@ -536,7 +682,6 @@
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.MaximizeBox = false;
-            this.MinimizeBox = false;
             this.Name = "Form1";
             this.Text = "AVSorter";
             this.Load += new System.EventHandler(this.Form1_Load);
@@ -552,6 +697,9 @@
             this.tabPage3.ResumeLayout(false);
             this.tabPage3.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.nud_ActorLessThan)).EndInit();
+            this.tabPage4.ResumeLayout(false);
+            this.tabPage4.PerformLayout();
+            this.cmenu_p4.ResumeLayout(false);
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -602,6 +750,20 @@
         private System.Windows.Forms.TextBox txt_FindStatus;
         private System.Windows.Forms.NumericUpDown nud_ActorLessThan;
         private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.TabPage tabPage4;
+        private System.Windows.Forms.Button btn_p4_Go1;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.TextBox txt_p4_keyword;
+        private System.Windows.Forms.ListView lv_p4_result;
+        private System.Windows.Forms.ColumnHeader columnHeader4;
+        private System.Windows.Forms.ColumnHeader columnHeader5;
+        private System.Windows.Forms.ColumnHeader columnHeader6;
+        private System.Windows.Forms.ContextMenuStrip cmenu_p4;
+        private System.Windows.Forms.ToolStripMenuItem cmenu_p4_item_copy;
+        private System.Windows.Forms.Button btn_p4_Clear;
+        private System.Windows.Forms.Button btn_paste_new;
+        private System.Windows.Forms.Button btn_p4_Go1_paste;
+        private System.Windows.Forms.Label lbl_p4_status;
     }
 }
 

+ 108 - 12
PicSo/Form1.cs

@@ -237,7 +237,7 @@ namespace PicSo
                 }
                 AVSORTER.FileProcessor.GetInstance().WriteLog();
             }
-            catch(Exception err )
+            catch (Exception err)
             {
                 MessageBox.Show(err.Message);
             }
@@ -258,7 +258,7 @@ namespace PicSo
         private void menu_ChangeFcode_Click(object sender, EventArgs e)
         {
             var inp = new InputBox();
-            if (listView1.SelectedItems.Count>0)
+            if (listView1.SelectedItems.Count > 0)
             {
                 inp.InputText = listView1.SelectedItems[0].SubItems[1].Text;
             }
@@ -342,13 +342,21 @@ namespace PicSo
             this.listView1.Items.Add(li);
 
         }
+        private void btn_paste_new_Click(object sender, EventArgs e)
+        {
+            if (Clipboard.ContainsText())
+            {
+                txt_EmptyItemKeyWord.Text = Clipboard.GetText();
+                btn_AddNewEmptyItem_Click(this, new EventArgs());
+            }
+        }
 
         private void listView1_DoubleClick(object sender, EventArgs e)
         {
             if (this.listView1.SelectedItems.Count > 0)
             {
                 var d = (listView1.SelectedItems[0].Tag as AVSORTER.SearchItem);
-                if (d.MovieDetail != null &&  !string.IsNullOrEmpty(d.MovieDetail.CoverFile))
+                if (d.MovieDetail != null && d != null && !string.IsNullOrEmpty(d.MovieDetail.CoverFile))
                 {
                     System.Diagnostics.Process.Start(d.MovieDetail.CoverFile);
                 }
@@ -413,14 +421,14 @@ namespace PicSo
         }
         private void txt_LocalSearchKeyWord_KeyPress(object sender, KeyPressEventArgs e)
         {
-            if (e.KeyChar==13)
+            if (e.KeyChar == 13)
             {
                 btn_LocalSearch_Click(sender, e);
             }
         }
         private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
         {
-            if (this.listBox1.SelectedItems.Count>0)
+            if (this.listBox1.SelectedItems.Count > 0)
             {
                 this.movieContainer1.Movie = (this.listBox1.SelectedItem as AVSORTER.Movie);
             }
@@ -428,7 +436,7 @@ namespace PicSo
         #endregion
 
         #region Page3
-        
+
 
         private void btnFind_Click(object sender, EventArgs e)
         {
@@ -447,7 +455,7 @@ namespace PicSo
 
         void worker_DoWork(object sender, DoWorkEventArgs e)
         {
-            var worker =  (e.Argument as BackgroundWorker);
+            var worker = (e.Argument as BackgroundWorker);
             List<AVSORTER.Movie> list = new List<AVSORTER.Movie>();
             var mvbs = arzon.FindInURL(txt_url.Text);
             worker.ReportProgress(0, "共找到影片:" + mvbs.Count.ToString());
@@ -459,8 +467,8 @@ namespace PicSo
                 var mv = fi.GetMovie(mvb);
                 no++;
                 worker.ReportProgress(0, no.ToString() + "/" + totalNo.ToString());
-                worker.ReportProgress(0,mv.AVCode + "\t" + mv.Title);
-                if (mv.Actor!=null && mv.Actor.Count <= nud_ActorLessThan.Value)
+                worker.ReportProgress(0, mv.AVCode + "\t" + mv.Title);
+                if (mv.Actor != null && mv.Actor.Count <= nud_ActorLessThan.Value)
                 {
                     Gets.MyWebClient wc = new Gets.MyWebClient();
                     wc.ReferURL = mvb.ItemURL;
@@ -505,7 +513,7 @@ namespace PicSo
 
         void worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
         {
-            if (e.ProgressPercentage==0)
+            if (e.ProgressPercentage == 0)
             {
                 txt_FindStatus.AppendText(e.UserState as string + "\r\n");
             }
@@ -514,9 +522,97 @@ namespace PicSo
         #endregion
 
 
-        
+        #region Page4
+        private void btn_p4_Go1_Click(object sender, EventArgs e)
+        {
+            lbl_p4_status.Visible = true;
+            btn_p4_Go1.Enabled = false;
+            btn_p4_Go1_paste.Enabled = false;
+
+
+            BackgroundWorker workerP4 = new BackgroundWorker();
+            workerP4.WorkerReportsProgress = true;
+            workerP4.ProgressChanged += workerP4_ProgressChanged;
+            workerP4.DoWork += workerP4_DoWork;
+            workerP4.RunWorkerCompleted += workerP4_RunWorkerCompleted;
+            workerP4.RunWorkerAsync();
+
+        }
+        void workerP4_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
+        {
+            lbl_p4_status.Visible = false;
+            btn_p4_Go1.Enabled = true;
+            btn_p4_Go1_paste.Enabled = true;
+        }
+
+        void workerP4_DoWork(object sender, DoWorkEventArgs e)
+        {
+            Gets.HttpHelper help = new Gets.HttpHelper(new System.Net.CookieContainer());
+            var html = help.GetHtml("http://www.torrentkitty.net/search/" + txt_p4_keyword.Text.Trim());
+            Console.WriteLine(html);
+            HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
+            doc.LoadHtml(html);
+
+            if (doc.DocumentNode.SelectNodes("//table[@id='archiveResult']/tr") == null)
+            {
+                return;
+            }
+
+            int n = doc.DocumentNode.SelectNodes("//table[@id='archiveResult']/tr").Count;
+
+            for (int i = 2; i < n; i++)
+            {
+                var name = doc.DocumentNode.SelectSingleNode("//table[@id='archiveResult']/tr[" + i + "]/td[@class='name']").InnerText;
+                ListViewItem li = new ListViewItem(name);
+                var size = doc.DocumentNode.SelectSingleNode("//table[@id='archiveResult']/tr[" + i + "]/td[@class='size']").InnerText;
+                li.SubItems.Add(size);
+                var link = doc.DocumentNode.SelectSingleNode("//table[@id='archiveResult']/tr[" + i + "]/td[@class='action']/a[2]").Attributes["href"].Value;
+                li.SubItems.Add(link);
+                lv_p4_result.Items.Add(li);
+            }
+            lv_p4_result.Items.Add(new ListViewItem("====="));
+        }
+
+        void workerP4_ProgressChanged(object sender, ProgressChangedEventArgs e)
+        {
+            
+        }
+        private void cmenu_p4_item_copy_Click(object sender, EventArgs e)
+        {
+            if (lv_p4_result.SelectedItems.Count==1)
+            {
+                var link=  lv_p4_result.SelectedItems[0].SubItems[2].Text;
+
+                Clipboard.SetText(link);
+
+            }
+        }
+        private void btn_p4_Clear_Click(object sender, EventArgs e)
+        {
+            lv_p4_result.Items.Clear();
+        }
+        private void btn_p4_Go1_paste_Click(object sender, EventArgs e)
+        {
+            if (Clipboard.ContainsText())
+            {
+                txt_p4_keyword.Text = Clipboard.GetText();
+                btn_p4_Go1_Click(this, new EventArgs());
+            }
+        }
+        #endregion
+
+
+
+
+
+
+
+
+
+
+
     }
 
-    
+
 
 }

+ 3 - 0
PicSo/Form1.resx

@@ -120,6 +120,9 @@
   <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>17, 17</value>
   </metadata>
+  <metadata name="cmenu_p4.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>182, 17</value>
+  </metadata>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>58</value>
   </metadata>

BIN
PicSo/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache