From 7f331e4918b5ae377764a0c14c7c857aa8ab3819 Mon Sep 17 00:00:00 2001 From: Neeko iko Date: Sun, 23 Feb 2025 15:02:19 -0700 Subject: [PATCH] added emulation script i made in the past. --- emulation/README.md | 12 ++++++++++++ emulation/ps3updatedownloader.py | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 emulation/README.md create mode 100644 emulation/ps3updatedownloader.py diff --git a/emulation/README.md b/emulation/README.md new file mode 100644 index 0000000..10778bc --- /dev/null +++ b/emulation/README.md @@ -0,0 +1,12 @@ +this folder contains some generic stuff i made for emulation, and this readme will go over the basic functionality of the files. +should it not be kept up to date - you should be able to at least have an inkling of an idea of what they may do from their filenames alone + + +# ps3updatedownloader.py + + CLI Program + this is a python script (as is shown by the filetype) that will intake a game ID and use playstations own servers to grab the update files for you. what you do with those files is up to you. + to use it, just run it with anything above python 3.5, and have the pypi package requests available in some capacity. + + +and thats it lol. get dunked on pal. diff --git a/emulation/ps3updatedownloader.py b/emulation/ps3updatedownloader.py new file mode 100644 index 0000000..0a06d7c --- /dev/null +++ b/emulation/ps3updatedownloader.py @@ -0,0 +1,24 @@ +#!/usr/bin/python +import requests + +UUID = input("copy-paste the serial of the game to download updates for: ") +updates = f"https://a0.ww.np.dl.playstation.net/tpl/np/{UUID}/{UUID}-ver.xml" +xml = requests.get(updates, verify=False).text +linkarray = [] +while True: + start = xml.find('url="') + 5 + end = xml.find('.pkg"') + 4 + if start == 4 or end == 3: + break + pkg = xml[start:end] + linkarray.append(pkg) + xml = xml[end:] +print(str(len(linkarray)) + " updates found") +for item in linkarray: + name = str(linkarray.index(item) + 1) + ".pkg" + with requests.get(item,stream = True, verify=False) as r: + r.raise_for_status() + with open("./updates/" +name, "wb") as f: + for chunk in r.iter_content(chunk_size=8192): + f.write(chunk) + print("finished: " + str(linkarray.index(item) + 1) + " of "+ str(len(linkarray)))