Add downloader.ps1
This commit is contained in:
parent
fd4cee84e4
commit
347cb27a1e
1 changed files with 38 additions and 0 deletions
38
downloader.ps1
Normal file
38
downloader.ps1
Normal file
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue