print_summary.ps1 1.3 KB

123456789101112131415161718192021222324252627282930
  1. if (Test-Path -Path $args[0] -PathType Leaf) {
  2. $file=$args[0]
  3. }
  4. else {
  5. Write-Host "CANNOT FIND LOG FILE"
  6. Exit 1
  7. }
  8. if ($args[1] -ne $null) {
  9. $output=$args[1]
  10. Write-Host "Outputting IDs to $output"
  11. }
  12. else {
  13. $output="./successful.txt"
  14. }
  15. Write-Host -NoNewline "Downloaded submissions: "
  16. Write-Host (Select-String -Path $file -Pattern "Downloaded submission" -AllMatches).Matches.Count
  17. Write-Host -NoNewline "Failed downloads: "
  18. Write-Host (Select-String -Path $file -Pattern "failed to download submission" -AllMatches).Matches.Count
  19. Write-Host -NoNewline "Files already downloaded: "
  20. Write-Host (Select-String -Path $file -Pattern "already exists, continuing" -AllMatches).Matches.Count
  21. Write-Host -NoNewline "Hard linked submissions: "
  22. Write-Host (Select-String -Path $file -Pattern "Hard link made" -AllMatches).Matches.Count
  23. Write-Host -NoNewline "Excluded submissions: "
  24. Write-Host (Select-String -Path $file -Pattern "in exclusion list" -AllMatches).Matches.Count
  25. Write-Host -NoNewline "Files with existing hash skipped: "
  26. Write-Host (Select-String -Path $file -Pattern "downloaded elsewhere" -AllMatches).Matches.Count
  27. Write-Host -NoNewline "Submissions from excluded subreddits: "
  28. Write-Host (Select-String -Path $file -Pattern "in skip list" -AllMatches).Matches.Count