Created
August 2, 2022 17:23
-
-
Save xsbee/3d29e34b2202731469c2cf159bad3470 to your computer and use it in GitHub Desktop.
Multithreaded downloader of Lolicon.
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
# Inspired by https://github.com/poly000/lolicon_api | |
# The ultimate script to jail :) | |
$url = "https://api.lolicon.app/setu/v2?r18=1&num=20" | |
$entries = Invoke-WebRequest $url | ConvertFrom-Json | |
$jobs = @() | |
foreach ($entry in $entries.data.urls.original) { | |
$entryUri = [System.Uri]$entry | |
$fileName = Split-Path $entryUri.LocalPath -Leaf | |
if (!(Test-Path $fileName -PathType Leaf)) { | |
$jobs += Start-ThreadJob -Name $fileName -ScriptBlock { | |
Invoke-WebRequest $using:entry -OutFile $using:fileName | |
} | |
} | |
} | |
if ($jobs) { | |
Wait-Job $jobs | % {$_.Name} | |
} | |
foreach ($job in $jobs) { | |
Remove-Job $job | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment