Port PSN pkg decryption to pure Python (drop Wine requirement)

This commit is contained in:
2026-09-07 22:45:00 -04:00
parent d458a9859c
commit 2ba24028a0
7 changed files with 330 additions and 35 deletions
+4 -7
View File
@@ -469,8 +469,8 @@ class NoPayStationSource(Source):
"""Browse NoPayStation .pkg lists and install PSP/PSX PSN content.
``content_type`` is ``"psp"`` (PSP_GAMES.tsv) or ``"psx"`` (PSX_GAMES.tsv).
Downloading decrypts the ``.pkg`` with the ``pkg2zip`` binary and writes a
``<TITLE_ID>/EBOOT.PBP`` game folder into ``dest_dir``.
Downloading decrypts the ``.pkg`` with the bundled pure-Python decryptor
and writes a ``<TITLE_ID>/EBOOT.PBP`` game folder into ``dest_dir``.
"""
label = "NoPayStation"
@@ -490,12 +490,9 @@ class NoPayStationSource(Source):
dest_dir = Path(dest_dir)
dest_dir.mkdir(parents=True, exist_ok=True)
# The bundled Python decryptor handles PSP/PSX directly; pkg2zip is
# only an optional fallback if a binary happens to be configured.
pkg2zip = nopaystation.find_pkg2zip(self.pkg2zip)
if pkg2zip is None:
raise RuntimeError(
"pkg2zip not found — install it (https://github.com/mmozeiko/pkg2zip) "
"or set its path in Settings → Store."
)
title_id = item.get("title_id") or item.get("content_id") or ""
pkg_name = re.sub(r"[^A-Za-z0-9_-]", "", title_id) or "pkg"
tmp = Path(tempfile.mkdtemp(prefix="nps-download-"))