Skip to content
This repository was archived by the owner on Feb 5, 2026. It is now read-only.
This repository was archived by the owner on Feb 5, 2026. It is now read-only.

If the pkg url contains a question mark, extraction will fail #29

Description

@Pretzelek

Duplication steps:
pynps -G -c psp -r usa "talkman travel tokyo"

[SEARCH] you're going to download the following files:

  1. PSP | NPUG80155 | USA | Game | TALKMAN TRAVEL TOKYO [17.72 MiB]
    Download files? [y/n]: y

[DOWNLOAD] TALKMAN TRAVEL TOKYO (US) [NPUG80155] for PSP
w2kCvtC25dQdGqSeGgl1oJel2ywCHKxvecsJJTIje4Pc6AMGmMJdIeyxX2pgY7d97pnjrYwVKUkGBj1 100%[====================================================================================================================================================================================================>] 17.72M 43.8MB/s in 0.4s

Traceback (most recent call last):
File "d:\python3\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "d:\python3\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "D:\Python3\Scripts\pynps.exe_main
.py", line 9, in
File "d:\python3\lib\site-packages\pynps\cli\cli.py", line 561, in cli_main
sha256_dl = checksum_file(downloaded_file_loc)
File "d:\python3\lib\site-packages\pynps\functions\functions.py", line 532, in checksum_file
with open(file, 'rb') as f:
OSError: [Errno 22] Invalid argument: 'G:/Games/pynps/PKG/PSP/GAMES/w2kCvtC25dQdGqSeGgl1oJel2ywCHKxvecsJJTIje4Pc6AMGmMJdIeyxX2pgY7d97pnjrYwVKUkGBj1Aca5vWHX9PeD7Sc099Dx7e.pkg?product=0084&country=us'

'?' in the URL gets turned into '@', but pynps is still looking for the file with '?'.

This can be fixed by adding
dl_dile_loc = dl_dile_loc.replace("?", "@") in cli.py, after
dl_dile_loc = f"{DLFOLDER}/PKG/{i['System']}/{i['Type']}/{i['PKG direct link'].split('/')[-1]}" as well as replacing

open(file, 'rb') as f:
with
open(file.replace("?", "@"), 'rb') as f:

in cli.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions