Created
January 3, 2011 16:14
-
-
Save OrigamiTech/763617 to your computer and use it in GitHub Desktop.
Downloads all the music from keygenjukebox.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Call me a n00b, but i'm not sure how to use this script -_-