Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit)

Well, thank you for replying, now we're getting somewhere but not quite there.

I followed your instructions, with your most up to date script and i got this error:


The term 'Invoke-WebRequest' is not recognized as the name of a cmdlet, 
function, script file, or operable program. 
Check the spelling of the name, or if a path was included, 
verify that the path is correct and try again.
At C:\waifu_solitaire v2.0.0\waifu_solitaire\v2.0.0\start.ps1:83 char:37
+             $img = Invoke-WebRequest <<<<  $Matches[1] -OutFile $out_path
    + CategoryInfo          : ObjectNotFound: (Invoke-WebRequest:String) [], C
   ommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I did some digging and turns out the Invoke-Webrequest was removed from Powershell 5. 

This guy seemingly have recreated the function itself, but when i tried to implement it a quick red message would appear and crash the cmd, can't debug, too fast. Maybe you have better tools:

https://github.com/cloudbase/unattended-setup-scripts/blob/master/FastWebRequest...

No, Invoke-WebRequest is present in version 5 (I am running 5.1 and it is still there). I found a post where it is explained, that the alias wget is deprecated in 5.1, but the original function is still there.

The only time where Invoke-WebRequest would not be present for you would be if you ran version 2 or lower. This is only the case on Windows 7. You can check this if you run a powershell window (Just type powershell into your windows search or press the Windows Key + R, type powershell and run it).

There type the command:

$PSVersionTable.PSVersion

If this shows for the Major column a version lower than 3 you are running on an old version and a solution for you would be to update your version here then it should run. 

As much as I want to fix this game I really don't want to find workarounds for web requests and Json parsing in version 2.0. I did this at one point for other stuff and it is a pain in the arse :P . (Also the version 2 on my system is somehow busted and I would either need to reinstall windows, setup a windows 7 VM or something similar just to test stuff.)

(+1)

Ah. I forgot to mention. I RUN Windows 7.  I don't like Win 10 since it uses way more of my Ram

I take it that this is a limitation of my own S.O., right?

Welp. Thank you for trying so hard in that case. We got so close tho.

Windows 7 just does not ship initially with the latest powershell but with the link here, you can download the installation for the newer powershell. This is the link for the installation to powershell 5.1 for Windows 7.

You don't have to update your OS just for that :)

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

Honestly can't thank you enough :D I really love this game and seeing it go to ruin is so sad so thank you again for creating fixes :DD

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.

(+1)

Thank you very much, i might try to dwell into HTML coding again because of thi

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.

It's hard work when you're flying blind.   Nice effort thinking ahead to guess where user might have the problem.    Many don't.  Kudos.