Skip to content

Instantly share code, notes, and snippets.

@OrigamiTech
Created January 3, 2011 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OrigamiTech/763617 to your computer and use it in GitHub Desktop.
Save OrigamiTech/763617 to your computer and use it in GitHub Desktop.
Downloads all the music from keygenjukebox.com
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Text.RegularExpressions;
using System.IO;
namespace KGJ_DL
{
class Program
{
static void Main(string[] args)
{
string
download_dir = "Downloads/",
kgj_url = "http://keygenjukebox.com/",
kgj_subdir = "m/";
if (!Directory.Exists(download_dir))
Directory.CreateDirectory(download_dir);
WebClient wc = new WebClient();
string data = wc.DownloadString(kgj_url);
MatchCollection mc = Regex.Matches(data, "value=\".+?\"");
for (int i = 0; i < mc.Count; i++)
{
if (mc[i].Value.EndsWith("mp3\""))
{
string path = mc[i].Value.Substring(7, mc[i].Value.Length - 8);
Console.ForegroundColor = ConsoleColor.Green;
try
{
if (!File.Exists(download_dir + path))
wc.DownloadFile(kgj_url + kgj_subdir + path, download_dir + path);
else
Console.ForegroundColor = ConsoleColor.Blue;
}
catch { Console.ForegroundColor = ConsoleColor.Red; }
Console.WriteLine((i + 1).ToString() + ": " + path);
}
}
Console.ReadLine();
}
}
}
@MrJayRod
Copy link

Call me a n00b, but i'm not sure how to use this script -_-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment