From 750c08bda5f39476d3cff64753663a80eabc2883 Mon Sep 17 00:00:00 2001 From: fireshaper Date: Sun, 4 Nov 2018 00:59:36 -0400 Subject: [PATCH] More updates for the new links --- Form1.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Form1.cs b/Form1.cs index 2af96fc..b8cc60b 100644 --- a/Form1.cs +++ b/Form1.cs @@ -25,7 +25,7 @@ public partial class Form1 : Form private String pbID; private int idCount = 0; - private IEnumerable nodes, descNodes, ulNodes; + private IEnumerable nodes, descNodes, ulNodes, liNodes; private System.Net.WebClient client = new System.Net.WebClient(); @@ -206,6 +206,7 @@ private void btnDownload_Click(object sender, EventArgs e) for (match = regex.Match(data); match.Success; match = match.NextMatch()) { string lastEV = ""; + List EVs = new List(); foreach (Group group in match.Groups) { @@ -245,7 +246,9 @@ private void btnDownload_Click(object sender, EventArgs e) else { ulNodes = doc.DocumentNode.Descendants("ul"); + //liNodes = doc.DocumentNode.Descendants("li"); int id = 0; + foreach (HtmlNode u in ulNodes) { @@ -256,7 +259,7 @@ private void btnDownload_Click(object sender, EventArgs e) { String[] c = b[i].Split('"'); - if (c[7] == "_blank"") + if (c.Length > 7 && c[7] == "_blank"") { string[] t0 = b[i].Split('>'); int index = 0; @@ -285,7 +288,7 @@ private void btnDownload_Click(object sender, EventArgs e) string encodedValue = gcURLArray[4]; - if (lastEV != encodedValue) + if (!EVs.Contains(encodedValue)) { byte[] urlData = Convert.FromBase64String(encodedValue); string decodedURL = Encoding.UTF8.GetString(urlData); @@ -300,7 +303,7 @@ private void btnDownload_Click(object sender, EventArgs e) Console.WriteLine(title); - lastEV = encodedValue; + EVs.Add(encodedValue); }