diff --git a/Classes/ChapterTycqzwClass.cs b/Classes/ChapterTycqzwClass.cs
new file mode 100644
index 0000000000000000000000000000000000000000..6ef3dd246445c0c7a1d539e2e508a8d6c1ed8ca5
--- /dev/null
+++ b/Classes/ChapterTycqzwClass.cs
@@ -0,0 +1,105 @@
+using HtmlAgilityPack;
+using HtmlToTxtWFA.Utils;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+
+namespace HtmlToTxtWFA.Classes
+{
+ ///
+ /// 章节 Tycqzw
+ ///
+ public class ChapterTycqzwClass : ChapterClass
+ {
+ public ChapterTycqzwClass() { }
+
+ public ChapterTycqzwClass(HtmlNode aElement, bool isStarted)
+ {
+ // 第1章 自救者天救之
+ string label = aElement.InnerText;
+ if (!isStarted && (label.StartsWith("第1章") || label.StartsWith("第一章") || label.StartsWith("第1回") || label.StartsWith("第一回")))
+ {
+ this.Label = label;
+ this.Url = aElement.GetAttributeValue("href", "");
+ }
+ else if (isStarted && label.Contains("第") && (label.Contains("章") || label.Contains("回")))
+ {
+ this.Label = label;
+ this.Url = aElement.GetAttributeValue("href", "");
+ }
+ }
+
+ public override List ReadChapterList(string HOST, string serialNumber)
+ {
+ HtmlWeb web = new HtmlWeb();
+ HtmlAgilityPack.HtmlDocument doc;
+ HtmlNodeCollection conNodes;
+
+ // 从url中加载
+ // http://www.tycqzw.net/135_135226/
+ doc = web.LoadFromWebAsync(HOST + "/" + serialNumber, Encoding.Default).Result;
+ if (doc == null)
+ {
+ MessageBox.Show("获取章节列表异常");
+ return new List();
+ }
+
+ conNodes = doc.DocumentNode.SelectNodes("//*[@id=\"list\"]");
+ if (conNodes == null || conNodes.Count == 0)
+ {
+ MessageBox.Show("获取章节列表异常");
+ return new List();
+ }
+
+ HtmlNodeCollection aNodes = conNodes[0].SelectNodes(".//a");
+ if (aNodes == null || aNodes.Count == 0)
+ {
+ MessageBox.Show("获取章节列表异常");
+ return new List();
+ }
+
+ bool isStarted = false;
+ List chapterList = new List();
+ for (int c = 0; c < aNodes.Count; c++)
+ {
+ // 第1章 自救者天救之
+ HtmlNode aNode = aNodes[c];
+ if (aNode == null)
+ {
+ continue;
+ }
+
+ ChapterTycqzwClass chapterClass = new ChapterTycqzwClass(aNode, isStarted);
+ if (!chapterClass.IsNull())
+ {
+ chapterList.Add(chapterClass);
+ if (!isStarted)
+ {
+ isStarted = true;
+ }
+ }
+ }
+
+ return chapterList;
+ }
+
+ public override void ToTxt(string filePath, string HOST)
+ {
+ // 从url中加载
+ // http://www.tycqzw.net/135_135226/48271449.html
+ HtmlAgilityPack.HtmlDocument doc = new HtmlWeb().LoadFromWebAsync(HOST + this.Url, Encoding.Default).Result;
+ if (doc == null)
+ {
+ return;
+ }
+
+ HtmlNodeCollection conNodes = doc.DocumentNode.SelectNodes("//div[@id='content']");
+ if (conNodes == null || conNodes.Count == 0)
+ {
+ return;
+ }
+
+ TxtUtil.Write(filePath, " " + this.Label + "\n\n" + conNodes[0].InnerText.Replace(" ", " ").Split("(本章完)")[0].Split("推荐")[0]);
+ }
+ }
+}
diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs
index 85edd099856478ed84a19721a8352dd36e02180b..278bbcc8039b8f398dd6e6262bbaf353fb21f4d5 100644
--- a/MainForm.Designer.cs
+++ b/MainForm.Designer.cs
@@ -168,7 +168,8 @@ namespace HtmlToTxtWFA
"乐文小说网",
"农夫小说网",
"泡泡中文",
- "速读谷"});
+ "速读谷",
+ "天域小说网"});
this.platformComboBox.Location = new System.Drawing.Point(84, 7);
this.platformComboBox.Name = "platformComboBox";
this.platformComboBox.Size = new System.Drawing.Size(107, 23);
diff --git a/MainForm.cs b/MainForm.cs
index 9930ada723c769827c5e6e9e9752eaabd5deea3a..815bdb09f0452c38264b9dc5eb00169c0fd40a76 100644
--- a/MainForm.cs
+++ b/MainForm.cs
@@ -24,6 +24,7 @@ namespace HtmlToTxtWFA
["农夫小说网"] = "https://www.nfxs.com",
["泡泡中文"] = "https://www.paozw.com",
["速读谷"] = "https://www.sudugu.com",
+ ["天域小说网"] = "http://www.tycqzw.net",
};
private List chapterList = new List();
@@ -149,6 +150,10 @@ namespace HtmlToTxtWFA
{
chapterList = new ChapterSuduguClass().ReadChapterList(host, serialNumber);
}
+ else if (platform.Equals("天域小说网"))
+ {
+ chapterList = new ChapterTycqzwClass().ReadChapterList(host, serialNumber);
+ }
else
{
MessageBox.Show("查询章节信息异常:平台暂不支持");