Add NoPayStation themes, DLC and minis support
This commit is contained in:
+9
-6
@@ -468,9 +468,10 @@ class LocalShareSource(Source):
|
||||
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 bundled pure-Python decryptor
|
||||
and writes a ``<TITLE_ID>/EBOOT.PBP`` game folder into ``dest_dir``.
|
||||
``content_type`` is ``"psp"`` (PSP_GAMES.tsv), ``"psx"`` (PSX_GAMES.tsv),
|
||||
``"theme"`` (PSP_THEMES.tsv) or ``"dlc"`` (PSP_DLCS.tsv). Downloading
|
||||
decrypts the ``.pkg`` with the bundled pure-Python decryptor and writes a
|
||||
``<TITLE_ID>/`` game folder into ``dest_dir``.
|
||||
"""
|
||||
|
||||
label = "NoPayStation"
|
||||
@@ -490,8 +491,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.
|
||||
# The bundled Python decryptor handles PSP/PSX/themes/DLC directly;
|
||||
# pkg2zip is only an optional fallback if a binary happens to be
|
||||
# configured (and only supports games/PSX).
|
||||
pkg2zip = nopaystation.find_pkg2zip(self.pkg2zip)
|
||||
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"
|
||||
@@ -501,8 +503,9 @@ class NoPayStationSource(Source):
|
||||
if progress_cb is not None:
|
||||
progress_cb("Downloading", 0.0, "")
|
||||
download_url(item["pkg_url"], pkg, None, progress_cb, cancel_event)
|
||||
kind_hint = self.content_type if self.content_type in ("theme", "dlc") else None
|
||||
folder = nopaystation.extract_pkg(pkg, title_id, dest_dir, pkg2zip,
|
||||
progress_cb, cancel_event)
|
||||
kind_hint, progress_cb, cancel_event)
|
||||
return folder
|
||||
finally:
|
||||
shutil.rmtree(tmp, ignore_errors=True)
|
||||
|
||||
Reference in New Issue
Block a user