Created
September 28, 2021 11:56
-
-
Save roman-yagodin/40e0cd868497ff283bd7b7c4c7ad22db to your computer and use it in GitHub Desktop.
Download entire DCSS morgue directory from underhound.eu for player
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
#!/usr/bin/pwsh | |
$userName = "usernName" | |
$baseUri = "https://underhound.eu/crawl/morgue/" | |
New-Item -Path "$userName" -ItemType Directory | |
Invoke-WebRequest -Uri "$baseUri/$userName" -OutFile "./$userName/$userName.html" | |
foreach ($line in Get-Content "./$userName/$userName.html") { | |
if ($line -match '<a href=\"(morgue-[^\"]+)\"') { | |
$fileName = $Matches[1] | |
Write-Output $fileName | |
Invoke-WebRequest -Uri "$baseUri/$userName/$fileName" -OutFile "./$userName/$fileName" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment