Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
DeviantArt download code
BetterWebClient pageClient = new BetterWebClient();
_cookieContainer = new CookieContainer();
_deviantPageString = pageClient.DownloadString(_url);
_cookieContainer.SetCookies(new Uri(_url), pageClient.GetCookies());
Regex downloadLinkRegex = new Regex(@"""(http://www\.deviantart\.com/download/\d*/.*)""");
string downloadUrl = downloadLinkRegex.Match(_deviantPageString).Groups[1].Value.Replace("&", "&");
BetterWebClient downloadClient = new BetterWebClient(_cookieContainer, _url);
downloadClient.DownloadFile(downloadUrl, Path.Combine("Downloads", _filename));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.