Created
          November 22, 2013 01:43 
        
      - 
      
 - 
        
Save mdumrauf/7593409 to your computer and use it in GitHub Desktop.  
    Script written in PowerShell that downloads all DB Multiverse manga pages
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | echo "Downlading.." | |
| $file = "" | |
| $client = new-object System.Net.WebClient | |
| for($i = 1; $i -le 797; $i++) | |
| { | |
| if ($i -lt 10) { $file = "000$($i)" } | |
| elseif (($i / 10) -lt 10) { $file = "00$($i)" } | |
| elseif (($i / 100) -lt 100) { $file = "0$($i)" } | |
| Try { | |
| $client.DownloadFile("http://www.dragonball-multiverse.com/es/pages/final/$($file).jpg", "C:\Users\mdumrauf\Desktop\dbz-multiverse\$($file).jpg") | |
| echo "INFO :: File $($file) download completed" | |
| } | |
| Catch | |
| { | |
| [System.Net.WebException] | |
| echo "WARN :: File $($file) is not a jpg! Downloading png instead.." | |
| Try { | |
| $client.DownloadFile("http://www.dragonball-multiverse.com/es/pages/final/$($file).png", "C:\Users\mdumrauf\Desktop\dbz-multiverse\$($file).png") | |
| echo "INFO :: File $($file) download completed" | |
| } | |
| Catch | |
| { | |
| [System.Net.WebException] | |
| echo "ERROR :: File $($file) is not a valid image! Ignoring." | |
| } | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment