To download the last version of ysoserial, just access the follow link:
https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar
You only need do a git clone, like that:
git clone https://github.com/0xGabe/ysoserial-generator
The ysoserial-generator.sh is a bash file to create payloads, you only need to change the ysoserial name and the command that you want to execute.