Homebrew WIP NSP Organizer and mass downloader

snoofly

Well-Known Member
Member
Joined
Aug 18, 2015
Messages
1,012
Trophies
0
Age
54
XP
2,133
Country
United Kingdom
I just pushed a new update. It should fix that error you received.

--------------------- MERGED ---------------------------



Download the new version, it will fix your issue.

--------------------- MERGED ---------------------------



Update I just pushed adds the ability to download titles you do not have a ticket for. If you do not have a ticket, it saves the titles with a .nsx extension. They can be unlocked later with the title key.
interesting re nsx
just got back
the sub is found via our favourite console combined with the other term for backups, apart from isos
any details on how you unlock an nsx once the key is available?
 

blawar

Developer
OP
Developer
Joined
Nov 21, 2016
Messages
1,708
Trophies
1
Age
40
XP
4,311
Country
United States
interesting re nsx
just got back
the sub is found via our favourite console combined with the other term for backups, apart from isos
any details on how you unlock an nsx once the key is available?

I am going to add the ability for it to automatically unlock the files whenever a valid title key is submitted via titlekeys.txt.

But if you want to know how to do it manually, it is a normal NSP pack, however the ticket packed inside contains all zero's for the title key. The lazy way to fix this, would be to unpack the entire package, fix the ticket, and then repack. However, the cleanest way is to just edit the 16 bytes in the ticket, in place using a hex editor. Once a title key is provided, it is a good idea to verify the NSP. NSX files cannot be verified.

--------------------- MERGED ---------------------------

interesting re nsx
just got back
the sub is found via our favourite console combined with the other term for backups, apart from isos
any details on how you unlock an nsx once the key is available?

Also, I found the sub, thanks :)
 
Last edited by blawar,

fpw76

Member
Newcomer
Joined
Dec 5, 2009
Messages
8
Trophies
1
Location
Sydney
XP
261
Country
Australia
Good job blawar - just a few notes:

I had to move the following code (lines 488-492)

Code:
if CDNSP.keysPath != '':
   CDNSP.keysArg = ' -k "%s"' % CDNSP.keysPath
else:
   CDNSP.keysArg = ''

to inside the following IF statement (line 481)

Code:
if os.path.isfile(CDNSP.configPath):
   CDNSP.hactoolPath, CDNSP.keysPath, CDNSP.NXclientPath, CDNSP.ShopNPath, CDNSP.reg, CDNSP.fw, CDNSP.deviceId, CDNSP.env, CDNSP.dbURL, CDNSP.nspout = CDNSP.load_config(CDNSP.configPath)
   <goes here>

otherwise I was getting the following error:
Code:
Traceback (most recent call last):
  File "nut.py", line 488, in <module>
    if CDNSP.keysPath != '':
AttributeError: module 'CDNSP' has no attribute 'keysPath'

Also, would it be possible to make a list of MD5 hashes (with corresponding titleIDs) and run unknown nsp files through it to get the correct ID?

Or read the XML tags from the file itself to get the ID/Version instead of relying on proper filenames? Both Version seems to be stored in the NSP file between tags <Id>..</Id> and <Version>...</Version>
 
Last edited by fpw76,

blawar

Developer
OP
Developer
Joined
Nov 21, 2016
Messages
1,708
Trophies
1
Age
40
XP
4,311
Country
United States
Good job blawar - just a few notes:

I had to move the following code (lines 488-492)

Code:
if CDNSP.keysPath != '':
   CDNSP.keysArg = ' -k "%s"' % CDNSP.keysPath
else:
   CDNSP.keysArg = ''

to inside the following IF statement (line 481)

Code:
if os.path.isfile(CDNSP.configPath):
   CDNSP.hactoolPath, CDNSP.keysPath, CDNSP.NXclientPath, CDNSP.ShopNPath, CDNSP.reg, CDNSP.fw, CDNSP.deviceId, CDNSP.env, CDNSP.dbURL, CDNSP.nspout = CDNSP.load_config(CDNSP.configPath)
   <goes here>

otherwise I was getting the following error:
Code:
Traceback (most recent call last):
  File "nut.py", line 488, in <module>
    if CDNSP.keysPath != '':
AttributeError: module 'CDNSP' has no attribute 'keysPath'

Also, would it be possible to make a list of MD5 hashes (with corresponding titleIDs) and run unknown nsp files through it to get the correct ID?

Or read the XML tags from the file itself to get the ID/Version instead of relying on proper filenames? Both Version seems to be stored in the NSP file between tags <Id>..</Id> and <Version>...</Version>

Thx for catching the CDNSP config file missing bug.

It would not be possible to create a checksum of the entire NSP file, because the NSP file's can be packed differently. The ticket CDNSP creates is... special.. and is defn ot the proper way to do it. If someone packages a proper ticket or a differently hacked ticket, the checksum would be different. There is also the matter that the NCA files could be packed in a different order changing the checksum.

I am going to add support to read directly from the NSP file for the title info, that is on my very near to-do list.
 

RahFah

Well-Known Member
Newcomer
Joined
Apr 10, 2009
Messages
72
Trophies
1
Age
12
XP
689
Country
Brazil
Thanks for the app. I used it to rename all my nsp files and works perfect

I just need to edit the titles id in the titleskey.txt to 16 digits. If I use with 32 digits, won't work.
 
  • Like
Reactions: morrison22

morrison22

Well-Known Member
Member
Joined
Nov 26, 2005
Messages
618
Trophies
0
XP
1,948
Country
United States
Thanks for the app. I used it to rename all my nsp files and works perfect

I just need to edit the titles id in the titleskey.txt to 16 digits. If I use with 32 digits, won't work.

Hmm, I am able to rename nsp's with the 32 digits TitleID/RightsID identifier in the titlekets.txt file. Try to start fresh, and make sure you use the latest version.
 
  • Like
Reactions: RahFah

blawar

Developer
OP
Developer
Joined
Nov 21, 2016
Messages
1,708
Trophies
1
Age
40
XP
4,311
Country
United States
Thanks for the app. I used it to rename all my nsp files and works perfect

I just need to edit the titles id in the titleskey.txt to 16 digits. If I use with 32 digits, won't work.

Can you provide me with your titlekeys.txt that was not working? you can zero out the keys, I dont need those.
 

blawar

Developer
OP
Developer
Joined
Nov 21, 2016
Messages
1,708
Trophies
1
Age
40
XP
4,311
Country
United States
Do I need to dump something from my NS to use this? Like any key?

It requires being copied into a working CDNSP directory if you want to download. So it requires the same files CDNSP requires. If you search hard enough, you can find a CDNSP GUI Bob distribution that has all of the files you need
 
  • Like
Reactions: suzsuzuki

Vantis

Active Member
Newcomer
Joined
Feb 12, 2018
Messages
33
Trophies
0
Age
43
XP
216
Country
Canada
I am wondering if I am the only one getting the files downloaded but they are all unknown names. Titles are not showing
 

RahFah

Well-Known Member
Newcomer
Joined
Apr 10, 2009
Messages
72
Trophies
1
Age
12
XP
689
Country
Brazil
I tryed the last files on GitHub and works perfect! No more problem with the 32 digits titlle ID.

To the CDNSP Bob Gui V4 recognize my downloaded NPS, I edit the "nut.json" like @morrison22 model:

Code:
{
    "paths": {
        "titleBase": "NSP/{name} [{id}] [v{version}].nsp",
        "titleDLC": "NSP/{name} [DLC] [{id}] [v{version}].nsp",
        "titleUpdate": "NSP/{name} [UPD][{id}][v{version}].nsp",
        "titleDemo": "titles/demos/{name}[{id}][v{version}].nsp",
        "titleDemoUpdate": "titles/demos/updates/{baseName}/{name}[{id}][v{version}].nsp",
        "scan": "."
    },
    "download": {
        "base": false,
        "update": false,
        "demo": false,
        "dlc": false,
        "sansTitleKey": false
    }
}

And change the program to write the Titles ID with lowercase. In the file "Nsp.py" I modified the line 112 to
Code:
"format = format.replace('{id}', self.cleanFilename(t.id.lower()))"

Thanks @blawar and @morrison22 for the help! :yayswitch:
 

cdndave

Member
Newcomer
Joined
Feb 20, 2006
Messages
14
Trophies
0
XP
120
Country
Canada
I noticed it fails to scan files with lower case in title IDs as well

thanks for this fix - it helped a little!

I tryed the last files on GitHub and works perfect! No more problem with the 32 digits titlle ID.

To the CDNSP Bob Gui V4 recognize my downloaded NPS, I edit the "nut.json" like @morrison22 model:

Code:
{
    "paths": {
        "titleBase": "NSP/{name} [{id}] [v{version}].nsp",
        "titleDLC": "NSP/{name} [DLC] [{id}] [v{version}].nsp",
        "titleUpdate": "NSP/{name} [UPD][{id}][v{version}].nsp",
        "titleDemo": "titles/demos/{name}[{id}][v{version}].nsp",
        "titleDemoUpdate": "titles/demos/updates/{baseName}/{name}[{id}][v{version}].nsp",
        "scan": "."
    },
    "download": {
        "base": false,
        "update": false,
        "demo": false,
        "dlc": false,
        "sansTitleKey": false
    }
}

And change the program to write the Titles ID with lowercase. In the file "Nsp.py" I modified the line 112 to
Code:
"format = format.replace('{id}', self.cleanFilename(t.id.lower()))"

Thanks @blawar and @morrison22 for the help! :yayswitch:
 
  • Like
Reactions: RahFah

blawar

Developer
OP
Developer
Joined
Nov 21, 2016
Messages
1,708
Trophies
1
Age
40
XP
4,311
Country
United States
I noticed it fails to scan files with lower case in title IDs as well

thanks for this fix - it helped a little!

Are you on the latest version?

--------------------- MERGED ---------------------------

I am wondering if I am the only one getting the files downloaded but they are all unknown names. Titles are not showing

That is a temporary bug, caused by the fact that CDNSP does not have access to the same titl key db that nut does, so it does not know what to name them. Re-run the script as @Troy896 said and it will fix. This is on my todo list to fix :)

--------------------- MERGED ---------------------------

Oh, I noticed the github was updated with some new files.. What's new on the development end?

Big things coming :) Wrote a NSP, NCA, and PFS0 implementation in python. So I can manipulate NSP's. The first thing to do with this, is read the title id from the NSP rather than extracting it from the filename :) Second thing will be to unlock NSX files by writing the title key to the ticket in the NSX, and third would be adding support for manipulating the required version in the XML file (as an option) as was explained in that other thread.
 
Last edited by blawar,

Vantis

Active Member
Newcomer
Joined
Feb 12, 2018
Messages
33
Trophies
0
Age
43
XP
216
Country
Canada
Everything works perfect. How do we get new games? Do we need a updated list? or will it auto download new titles when available?

Thank you
 

Vantis

Active Member
Newcomer
Joined
Feb 12, 2018
Messages
33
Trophies
0
Age
43
XP
216
Country
Canada
Anyone have a issue with latest files ?

It does not pack to a .nsp but a .nsx

Any help would be great thank you
 

morrison22

Well-Known Member
Member
Joined
Nov 26, 2005
Messages
618
Trophies
0
XP
1,948
Country
United States
Anyone have a issue with latest files ?

It does not pack to a .nsp but a .nsx

Any help would be great thank you
“nut.py -h” for help
“nut.py -U to update list
“nut.py -D to download All (games/dlc/updates)
“nut.py -so” to scan and organize files into folders as specified in the configuration file.
.nsx files are locked .nsp files (without titlekey)
When a titlekey becomes available, you are notified and you can unlock the nsx and convert to nsp by typing “nut.py —unlock-all”
 
Last edited by morrison22,
  • Like
Reactions: Vantis

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    The Real Jdbye @ The Real Jdbye: don't mind me, just liking all of SDIO's posts, they deserve it for...