chanSaver
This might interest you: Simple PHP - Learn Php In 17 Hours
Save images from your favorite chan imageboards.
Tested and working on 4chan and 2chan.
Just enter thread URL and it will create a directory with the name of that thread, then start leeching all of the images.
Source code (Neverfail.cs)
-
using System;
-
using System.Collections.Generic;
-
using System.ComponentModel;
-
using System.Data;
-
using System.Drawing;
-
using System.Text;
-
using System.Windows.Forms;
-
-
using System.IO;
-
using System.Net;
-
using System.Text.RegularExpressions;
-
using System.Threading;
-
-
namespace _chanSaver
-
{
-
public partial class Neverfail : Form
-
{
-
public Neverfail()
-
{
-
InitializeComponent();
-
}
-
-
string content = "";
-
string threadname = "";
-
-
private void btnGo_Click(object sender, EventArgs e)
-
{
-
btnGo.Enabled = false;
-
-
label1.Text = "";
-
lblProgress.Text = "";
-
progressBar1.Value = 0;
-
progressBar1.Maximum = 0;
-
-
content = "";
-
content = x.DownloadString(txtURL.Text);
-
string[] urlparts = txtURL.Text.Split(‘/’);
-
threadname = urlparts[5];
-
if (threadname.Contains(".")) { threadname = threadname.Substring(0, threadname.IndexOf(‘.’)); }
-
txtURL.Text = "";
-
-
workThread.Start();
-
}
-
-
private void WorkThread()
-
{
-
label1.Text = "Leeching..";
-
-
MatchCollection matches = Regex.Matches(content, @”\<a><img alt="" />[\S]*?)"" target=""_blank""\>\d+.(jpg|jpeg|gif|bmp|png)\<\/a\>-\(", RegexOptions.IgnoreCase);
-
progressBar1.Maximum = matches.Count;
-
-
Directory.CreateDirectory(threadname);
-
-
foreach (Match match in matches)
-
{
-
GroupCollection groups = match.Groups;
-
-
string imagename = "";
-
string[] parts = groups["image"].Value.Split(‘/’);
-
foreach (string part in parts)
-
imagename = part;
-
imagename = threadname + "/" + imagename;
-
-
while(!File.Exists(imagename))
-
{
-
try
-
{
-
y.DownloadFile(groups["image"].Value, imagename);
-
}
-
catch(System.Net.WebException we)
-
{
-
break;
-
}
-
Thread.Sleep(500);
-
}
-
-
progressBar1.Value++;
-
progressBar1.Refresh();
-
-
lblProgress.Text = progressBar1.Value + " / " + progressBar1.Maximum;
-
lblProgress.Refresh();
-
}
-
-
label1.Text = "Done! Fkn saved " + progressBar1.Maximum + " images. Now leech next thread fag.";
-
btnGo.Enabled = true;
-
}
-
}
-
}</a>

Leave a Reply