Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $waifu = Read-Host -Prompt "Waifu name?"
- $waifu_path = "waifus\$waifu"
- if (-not (Test-Path $waifu_path))
- {
- mkdir "waifus\$waifu" | Out-Null
- $full_page = $true
- $match_count = 0
- $page = 0
- while($full_page -and $page -lt 3)
- {
- $start_page_id = 42 * $page
- $main_url_base = "https://gelbooru.com/index.php?page=post&s=list&tags=$waifu+rating%3aexplicit+sort%3ascore%3adesc+-animated_gif+-animated+-webm+solo+-absurdres&pid=$start_page_id"
- $response = Invoke-WebRequest $main_url_base
- ($response.Content | Select-String -Pattern 'js-pop" id="p.\d*" href="(.*?)"' -AllMatches).Matches.Value |
- % {
- $_ -match 'js-pop" id="p.\d*" href="(.*?)"' | Out-Null
- $match_count = ($match_count + 1);
- $url = "https:" + ($Matches[1] -replace "amp;","")
- $response = Invoke-WebRequest $url
- $response.Content -match 'href="(https://img2.gelbooru.com/images/.*?\.(.*?))"' | Out-Null
- $out_path = "$waifu_path\$match_count." + $Matches[2]
- $img = Invoke-WebRequest $Matches[1] -OutFile $out_path
- }
- $page++
- $full_page = $match_count -eq 42
- }
- }
- .\waifu_solitaire.exe
Add Comment
Please, Sign In to add comment