Hacking WIP Material-NSP - A simple GUI for CDNSP

Gimzie

professional moron
Member
Joined
Aug 6, 2016
Messages
278
Trophies
0
XP
988
Country
United States

Robman2122

Well-Known Member
Newcomer
Joined
Oct 14, 2015
Messages
84
Trophies
0
Age
34
XP
274
Country
United States
I'm playing around with this. Just a couple notes I have for possible improvements/features:

1. Auto rename NSP file to Game name after download/packing.
2. Custom path for downloaded files (after they are finished downloading and packing, I understand the python script dumps them in the same folder as itself)
3. Cleanup of NCA files after download to cut down on disk space being used.
4. For the update version input, have it move up in increments of 65536 instead of 1

In the original thread, I had come up with a batch script to do most of this, but I really like the GUI you've created. It really streamlines the process!
 
  • Like
Reactions: Olmectron

Olmectron

Well-Known Member
OP
Member
Joined
Dec 31, 2012
Messages
2,657
Trophies
2
Age
31
Location
A game
XP
3,855
Country
Mexico
Can you add source code?
Yep, I plan on releasing it. I just want to clean it a bit, since I did this in a rush for 8 hours, and my code is really messy.

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

I'm playing around with this. Just a couple notes I have for possible improvements/features:

1. Auto rename NSP file to Game name after download/packing.
2. Custom path for downloaded files (after they are finished downloading and packing, I understand the python script dumps them in the same folder as itself)
3. Cleanup of NCA files after download to cut down on disk space being used.
4. For the update version input, have it move up in increments of 65536 instead of 1

In the original thread, I had come up with a batch script to do most of this, but I really like the GUI you've created. It really streamlines the process!
Thanks for youc comments.

Yeah, definitely about the NSP renaming. I thought about setting a "download" directory, so that I would copy and rename NSP files automatically there, and delete the whole created directory with NCA files (would be optional, of course). That's next after adding some way of queueing downloads instead of downloading them all at the same time.

I just let the update download version free because I don't really know about update downloading. But of course, if it should only contain increments of 65536? Or was it 65535? I can lock it that way in the input.
 

Robman2122

Well-Known Member
Newcomer
Joined
Oct 14, 2015
Messages
84
Trophies
0
Age
34
XP
274
Country
United States
Another idea,

To have the option of downloading both the base game and an update, whether it tandem or one after the other. One thing I was trying to figure out with my batch script was to have it do a readout using the -i command outputted to a txt file and then have a way to parse that information to grab the base game and only the latest update package, rather than every update package, like my script currently does.
 
  • Like
Reactions: Olmectron

Olmectron

Well-Known Member
OP
Member
Joined
Dec 31, 2012
Messages
2,657
Trophies
2
Age
31
Location
A game
XP
3,855
Country
Mexico
This look pretty good, any clues where to get the json?
Sorry. Tried to find a way to add you to the discord server, but it seems I can't since I'm not an admin...

Hmmm. I guess I could say it's a https://hastebin.com/ raw address?

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

Another idea,

To have the option of downloading both the base game and an update, whether it tandem or one after the other. One thing I was trying to figure out with my batch script was to have it do a readout using the -i command outputted to a txt file and then have a way to parse that information to grab the base game and only the latest update package, rather than every update package, like my script currently does.
Could you share me a link your script, please?
 
D

Deleted User

Guest
I set the path but it still won't find it. Also why is it an installer? I'd rather have the option to just download a zip of the files.
 

Attachments

  • Capture.PNG
    Capture.PNG
    21.5 KB · Views: 362

Olmectron

Well-Known Member
OP
Member
Joined
Dec 31, 2012
Messages
2,657
Trophies
2
Age
31
Location
A game
XP
3,855
Country
Mexico
I set the path but it still won't find it. Also why is it an installer? I'd rather have the option to just download a zip of the files.
Did you click the little disk button icon to the left of the field?

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

I set the path but it still won't find it. Also why is it an installer? I'd rather have the option to just download a zip of the files.
This one:

upload_2018-7-7_15-44-0.png
 

Olmectron

Well-Known Member
OP
Member
Joined
Dec 31, 2012
Messages
2,657
Trophies
2
Age
31
Location
A game
XP
3,855
Country
Mexico
What filetype should it be? The program still says json
Yeah, I failed to remove it.

The extension doesn't matter anymore. As long as it finds that structure. Title ID, Title Key and Name, separated by a | symbol, per line

I changed it, since it was being more used than the titles.json
 
D

Deleted User

Guest
Yeah, I failed to remove it.

The extension doesn't matter anymore. As long as it finds that structure. Title ID, Title Key and Name, separated by a | symbol, per line

I changed it, since it was being more used than the titles.json
Okay I got it loading the file now but it won't download anything. It just stays at 0%
 

Olmectron

Well-Known Member
OP
Member
Joined
Dec 31, 2012
Messages
2,657
Trophies
2
Age
31
Location
A game
XP
3,855
Country
Mexico
Okay I got it loading the file now but it won't download anything. It just stays at 0%
What python script version are you using?

I've tested the one here in GBATemp and the CDNSP Next found in Discord, and it works with both right now.

Click the "Open log dir" button, look for the directory named like the titleId you tried to download, and enter. Order by modified date, so you see the latest logs. Open them (if they are blank, wait a minute, and open them again). Any errors thrown by python should be there.
 
D

Deleted User

Guest
What python script version are you using?

I've tested the one here in GBATemp and the CDNSP Next found in Discord, and it works with both right now.

Click the "Open log dir" button, look for the directory named like the titleId you tried to download, and enter. Order by modified date, so you see the latest logs. Open them (if they are blank, wait a minute, and open them again). Any errors thrown by python should be there.
The open log button doesn't work, but I found the logs myself:
{"message":"stderr: Traceback (most recent call last):\r\n File \"E:\\CDNSP\\\\CDNSP.py\", line 687, in <module>\r\n sys.exit(main())\r\n File \"E:\\CDNSP\\\\CDNSP.py\", line 660, in main\r\n download_game(tid, ver, tkey, nspRepack=args.repack)\r\n File \"E:\\CDNSP\\\\CDNSP.py\", line 377, in download_game\r\n temp = getName(tid) + \" [\" + tid + \"]\"\r\n File \"E:\\CDNSP\\\\CDNSP.py\", line 177, in getName\r\n r = make_request('GET', url, certificate=ShopNPath)\r\n File \"E:\\CDNSP\\\\CDNSP.py\", line 97, in make_request\r\n r = requests.request(method, url, cert=certificate, headers=reqHd, verify=False, stream=True)\r\n File \"C:\\Python36\\lib\\site-packages\\requests\\api.py\", line 58, in request\r\n return session.request(method=method, url=url, **kwargs)\r\n File \"C:\\Python36\\lib\\site-packages\\requests\\sessions.py\", line 508, in request\r\n resp = self.send(prep, **send_kwargs)\r\n File \"C:\\Python36\\lib\\site-packages\\requests\\sessions.py\", line 618, in send\r\n r = adapter.send(request, **kwargs)\r\n File \"C:\\Python36\\lib\\site-packages\\requests\\adapters.py\", line 407, in send\r\n self.cert_verify(conn, request.url, verify, cert)\r\n File \"C:\\Python36\\lib\\site-packages\\requests\\adapters.py\", line 248, in cert_verify\r\n \"invalid path: {0}\".format(conn.cert_file))\r\nOSError: Could not find the TLS certificate file, invalid path: shopn.pem\r\n","level":"error"}

I have all of those files it's referencing. I got it on /hbg/ a few days ago and it works fine.
 

Olmectron

Well-Known Member
OP
Member
Joined
Dec 31, 2012
Messages
2,657
Trophies
2
Age
31
Location
A game
XP
3,855
Country
Mexico
Error: Could not find the TLS certificate file, invalid path: shopn.pem


This sounds like you haven't set up your paths in CDNSPConfig.json? Try using full paths, since even in the newest versions, where it's supposed to work with relative paths, it sometimes fails.

I'm no expert in the Python side though, so if this doesn't work, I suggest you to ask in the python script thread, sorry.
 

Olmectron

Well-Known Member
OP
Member
Joined
Dec 31, 2012
Messages
2,657
Trophies
2
Age
31
Location
A game
XP
3,855
Country
Mexico
Version 0.9.8
https://www.dropbox.com/s/3o7gxnye5dpavuq/material-nsp Setup 0.9.8.zip?dl=0
  • Added queued downloads. Simply select if you want your downloads simultaneous or queued before adding titles to the list.
  • Some other minor adjustments for indicating when file is being processed after download is finished (when the NSP packaging occurs), so it no longer looks like nothing is happening.


upload_2018-7-7_16-44-37.png
 

kevin_1351

Well-Known Member
Newcomer
Joined
Apr 20, 2014
Messages
88
Trophies
0
Age
29
Location
Lugano, Switzerland
XP
497
Country
Switzerland
Version 0.9.8
https://www.dropbox.com/s/3o7gxnye5dpavuq/material-nsp Setup 0.9.8.zip?dl=0
  • Added queued downloads. Simply select if you want your downloads simultaneous or queued before adding titles to the list.
  • Some other minor adjustments for indicating when file is being processed after download is finished (when the NSP packaging occurs), so it no longer looks like nothing is happening.


View attachment 134896

Change the css such that the settings stay hidden even when the window is wide please. Awesome work.
 
  • Like
Reactions: Olmectron

Olmectron

Well-Known Member
OP
Member
Joined
Dec 31, 2012
Messages
2,657
Trophies
2
Age
31
Location
A game
XP
3,855
Country
Mexico
Also, since CDNSP is written in python 3, and many of us have python 3 set as "python3", please add support for that as well. Thanks a lot :)

If you want more hands on the project, feel free to ask.
You mean the name of the evironment variable for calling python?

Alright. Meanwhile, you could set the path of your binary in the settings for it to work.

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

MacOS version anyone? Thanks!
Does hactool.exe work in MacOS?

If so, after I share the source, someone with a Mac could help us compile for Mac.

Again, we need a hactool alternative for Mac. If there is one already, please tell me, I could look into it for when I open source it so someone else (with a Mac) could compile it.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    SylverReZ @ SylverReZ: @realtimesave, Sup