Viewing post in Waifu Solitaire - Lewd Edition comments
I apologise as I do not wish to bother you any further however I've followed your steps on windows 10 and tried to run it but end up with this error and I really love this game
Invoke-WebRequest : The remote name could not be resolved: 'https' At D:\;)\waifu_solitaire\v2.0.0\start1.ps1:82 char:25 + $response = Invoke-WebRequest $url + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand Invoke-WebRequest : Cannot validate argument on parameter 'Uri'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At D:\;)\waifu_solitaire\v2.0.0\start1.ps1:88 char:38 + $img = Invoke-WebRequest $Matches[1] -OutFile $out_path + ~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Invoke-WebRequest], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Im not proficient in powershell script however I believe this line
($response.Content | Select-String -Pattern 'js-pop" id="p.\d*" href="(.*?)"' -AllMatches)
Is returning null
No worries. I wrote it and fixing it because gelbooru is changing its website is really not a big deal. I rather have to thank you for posting the error and so on. Helped a lot with fixing it :)
Should be working now with this script: https://pastebin.com/K1ae96KX
Glad to see that you keep it updated ^^
I know i might be asking too much but is it possible for you to change it to other website like Rule34.xxx or at least teach me how to? I spent time googling finding the regexes to no avail and trying to mess around with the coding on my own by changing the website.
Thanks in advanc
Here is the version for Rule34.xxx: https://pastebin.com/H4LAjX7b and the updated version for the old one (Just some syntax things on my side, so no need to download the new one if you already have the old one): https://pastebin.com/q7ZDqLYp
You still have to create your own .bat file (just copy start.bat, rename it and change the text in it to the right .ps1 file)
I also added some comments on what to do if you want to change websites. Sadly it is not very straight forward and you kind of have to understand regexes, a little bit of HTML and of course some PowerShell. But they might help to give at least some pointers on what to do.
So... this works quite well. Too well, one might say. I was scrolling through the images it downloaded and I reach number 47/48 and saw it was still downloading. Turns out it was currently downloading image 73... I really don't have much use for images past 52, and anything more than 60 is probably excessive. So if anyone finds this fix, don't let it run and walk away or something.
Ah right. I think it downloads number of pages instead of number of images, which is kind of dumb ^^.
For a fix add
if ($match_count -gt 52) { break }
after the line
"$match_count = ($match_count + 1);"
This should stop the loop after downloading 52 images. If there are too few images, just up the number in the if.
Hope that helps.
Don't know if it helps, but when going over the script I found a few more possible problems + I thought it was a bit slow, so I made it faster.
If that does not help, where do you see the errors? If you also see the errors, when you only start the game (not my script), then something in there is going wrong and I can't change that. Sorry.
I really hope that this is still open but I've been trying for an embarrasing amount of time to get this to work. The powershell doesns't isntantly kill itself, and I got to the part where it makes sure I know what I'm talking about with choosing 1 thourhg 9 but in the end it still tells me
IndexError: List index out of range
What do I do about this?