diff --git a/downloader.ps1 b/downloader.ps1 new file mode 100644 index 0000000..26c08c4 --- /dev/null +++ b/downloader.ps1 @@ -0,0 +1,38 @@ +# Catbox Downloader Script by Yuuki +# © https://raiza.dev/ - 2024-20XX + +Get-ChildItem "./" -Filter "y2k12-*.txt" | +Foreach-Object { + $index = 0 + $fileNames = @() + $content = Get-Content $_.FullName + $links = "" + + ForEach ($line in $($content -split "`r`n")) + { + If ($line.StartsWith("mv ")) { + $f = $line.Substring($line.IndexOf('y2k12-')) + + $fileNames += $f + } + } + + ForEach ($line in $($content -split "`r`n")) + { + If ($line.StartsWith("https://files.catbox.moe/")) + { + $f = $line.Substring($line.IndexOf(".moe/") + 5) + + If ([System.IO.File]::Exists($fileNames[$index])) + { + Write-Host "File already downloaded." + } + Else + { + Write-Host "Downloading" $fileNames[$index] "(" $line ")" + Invoke-WebRequest -Uri $line -OutFile $fileNames[$index] + } + $index += 1 + } + } +} \ No newline at end of file