That script has an issue with if the test server is specified then the share image URL returned is bad. I submitted a pull request to fix it, but for now a working version is available on my repo. I published a compiled binary that you can just download and use if you don't want to compile it yourself.
Edit: Looks like my pull request was accepted, so you can use the original repo.