Skip to content

Commit

Permalink
More updates for the new links
Browse files Browse the repository at this point in the history
  • Loading branch information
fireshaper committed Nov 4, 2018
1 parent 19ed3ae commit 750c08b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class Form1 : Form
private String pbID;
private int idCount = 0;

private IEnumerable<HtmlNode> nodes, descNodes, ulNodes;
private IEnumerable<HtmlNode> nodes, descNodes, ulNodes, liNodes;

private System.Net.WebClient client = new System.Net.WebClient();

Expand Down Expand Up @@ -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<string> EVs = new List<string>();

foreach (Group group in match.Groups)
{
Expand Down Expand Up @@ -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)
{
Expand All @@ -256,7 +259,7 @@ private void btnDownload_Click(object sender, EventArgs e)
{
String[] c = b[i].Split('"');

if (c[7] == "_blank&quot;")
if (c.Length > 7 && c[7] == "_blank&quot;")
{
string[] t0 = b[i].Split('>');
int index = 0;
Expand Down Expand Up @@ -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);
Expand All @@ -300,7 +303,7 @@ private void btnDownload_Click(object sender, EventArgs e)

Console.WriteLine(title);

lastEV = encodedValue;
EVs.Add(encodedValue);
}


Expand Down

0 comments on commit 750c08b

Please sign in to comment.