-
-
Save Ditti4/429b8fcd512c6b64a244 to your computer and use it in GitHub Desktop.
DeviantArt download code
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
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