RainbowCookie32 / rusty-psn

A GUI/CLI tool for downloading PS3 and PS4 game updates
MIT License
379 stars 17 forks source link

Add support for PS4 multipart updates #249

Closed sarpt closed 2 months ago

sarpt commented 2 months ago

This PR adds basic support for fetching PS4 multipart updates. The PS4 update packages come in two variants: multipart full update containing every version to date in parts split below ~4GB, and delta updates which only contain changes since the previous version. This implementation adds support for the former, by fetching information about the latest version and providing list of parts to download: image

Since I'm not sure which endpoint exposes older versions of PS4 updates (I could only find urls pointing to the latest version), providing an option to download delta update seems to be of lesser priority, since a delta is only useful with older versions. If there's demand for it, or if there's a way to fetch older versions, it could be added later.

Parts are provided to download in a list, just like different versions of PS3 updates are. If the whole update pkg is not split (does not exceed 4GB), the element in a list won't specify a part number. Basically, part entries behave for PS4 updates as different versions entries behave for PS3 updates, both in egui and CLI, and the major difference is that a part number is shown next to the version when it's applicable.

There aren't any changes to file creation behavior and filesystem operations. Hashing is modified to allow hashing of the whole package, since PS4 multipart updates don't seem to embed hash as a suffix to pkg data.

Tested on: Linux 6.6.47-1-MANJARO x86_64 with an Xfce DE. Unfortunately I have neither a Windows nor a Mac machine to test it there. In my case newly added dependencies did not require any additional system packages to be installed.

RainbowCookie32 commented 2 months ago

Wow, thanks for the feature! Been meaning to do this for a really long time, but never got around to it. I'll get to reviewing, and I can test on Windows (macOS we'll just hope for the best lol)

RainbowCookie32 commented 2 months ago

By the way, would you mind updating the README to mention that PS4 updates can also be downloaded now?

sarpt commented 2 months ago

By the way, would you mind updating the README to mention that PS4 updates can also be downloaded now?

Done, I've added "PS3 & PS4" to the readme.

RainbowCookie32 commented 2 months ago

Well, everything seems to be working so I'll be merging and tagging a new release. Thanks again for the feature!