Code Monkey home page Code Monkey logo

nut's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nut's Issues

NSZ Support

Hey Blawar. I was wondering if you had read up on nsZip. It's a compressor for NSP files that got released awhile back and it works fairly well, but it's not supported much by anyone. Do you think you could see if it's something you'd be willing to add support for in NUT? It's be nice to have the benefit of saved space and inventory control. lol

Here's the git:
https://github.com/nicoboss/nsZip

Thanks for all you too bossman.

Language Support

Is there any chance to get the description in other languages, e.g. in german?

rescan

I was wondering if there is a function in the API that will rescan the scan directory. I saw the function getScan but if i go to api/scan it does something, but I do not see the newly added games that are put in the directory. I hope someone can help me!

[Bug] Duplicate icons

Using FTP.

Icons may appear twice in the grid view, where one game's icon overwrites a different game. Can occasionally be fixed by going to a different network folder in menu.

Example below shows a few games icons duplicated.

2018093021065100-db1426d1dfd034027cecde9c2dd914b8

All set-masterkeyN commands fail because Titles are not initialized yet

Script exits with unhandled exception if you try to change master key (any switch like "--set-masterkey4").

Traceback (most recent call last):
  File "nut.py", line 879, in <module>
    f = Fs.Nsp(args.set_masterkey5, 'r+b')
  File "E:\Downloads\nut-master\nut-master\Fs\Nsp.py", line 35, in __init__
    super(Nsp, self).__init__(None, path, mode)
  File "E:\Downloads\nut-master\nut-master\Fs\Pfs0.py", line 24, in __init__
    super(Pfs0, self).__init__(buffer, path, mode, cryptoType, cryptoKey, cryptoCounter)
  File "E:\Downloads\nut-master\nut-master\Fs\BaseFs.py", line 40, in __init__
    super(BaseFs, self).__init__(path, mode, cryptoType, cryptoKey, cryptoCounter)
  File "E:\Downloads\nut-master\nut-master\Fs\File.py", line 381, in __init__
    super(File, self).__init__(path, mode, cryptoType, cryptoKey, cryptoCounter)
  File "E:\Downloads\nut-master\nut-master\Fs\File.py", line 258, in __init__
    super(BufferedFile, self).__init__(path, mode, cryptoType, cryptoKey, cryptoCounter)
  File "E:\Downloads\nut-master\nut-master\Fs\File.py", line 28, in __init__
    self.open(path, mode, cryptoType, cryptoKey, cryptoCounter)
  File "E:\Downloads\nut-master\nut-master\Fs\Nsp.py", line 233, in open
    super(Nsp, self).open(path or self.path, mode, cryptoType, cryptoKey, cryptoCounter)
  File "E:\Downloads\nut-master\nut-master\Fs\Pfs0.py", line 100, in open
    self.files.append(self.partition(offset + headerSize, f.size, f))
  File "E:\Downloads\nut-master\nut-master\Fs\File.py", line 64, in partition
    n.open(None, None, cryptoType, cryptoKey, cryptoCounter)
  File "E:\Downloads\nut-master\nut-master\Fs\Nca.py", line 212, in open
    self.partition(0x0, 0xC00, self.header, Fs.Type.Crypto.XTS, uhx(Keys.get('header_key')))
  File "E:\Downloads\nut-master\nut-master\Fs\File.py", line 64, in partition
    n.open(None, None, cryptoType, cryptoKey, cryptoCounter)
  File "E:\Downloads\nut-master\nut-master\Fs\Nca.py", line 136, in open
    if self.titleId.upper() in Titles.keys() and Titles.get(self.titleId.upper()).key:
  File "lib\Titles.py", line 99, in keys
    return titles.keys()

Possible fix (for a single case):

if args.set_masterkey5:
   initTitles()  #  add this line 
   initFiles()   #  add this line 
   f = Fs.Nsp(args.set_masterkey5, 'r+b')
   f.setMasterKeyRev(5)
   f.flush()
   f.close()
   pass

QNAP OS

Is it possible to compile NUT for Qnap OS? It would be great to download games right on Qnap and install them to Switch directly from there.

Encoding invalid keyword on Mac OS X

Hi,
I’m on Mac OS X
When running
nut.py -s --scrape
nut.py --server
I got the following message:
TypeError: “encoding” is a invalid keyword argument for this function

It is related to file config.py line 134
Thanks

Encoding issue when renaming. ' and é

There was issue with accents.

organizing
Traceback (most recent call last):
File "nut.py", line 606, in
nut.organize()
File "/srv/dev-disk-by-label-Malinka-Media/Home/sephirot/nut/nut/init.py", line 140, in organize
f.move()
File "/srv/dev-disk-by-label-Malinka-Media/Home/sephirot/nut/Fs/Nsp.py", line 252, in move
if os.path.isfile(self.fileName()) and os.path.abspath(self.path) == os.path.abspath(self.fileName()):
File "/usr/local/lib/python3.6/genericpath.py", line 30, in isfile
st = os.stat(path)
UnicodeEncodeError: 'ascii' codec can't encode character '\u2019' in position 21: ordinal not in range(128)

I have added
#!/usr/bin/python3

-- coding: utf-8 --

to every file that was missing t.

Then there was an issue with 'é' like in Pokémon.
The unicode string for \xe9 is an accented e - é

It turned out both issues were in both "Let's go" Pokemon updates. and Tatsujin games.

usb exception: [Errno None] b'libusb0-dll:err

Getting this error part way through USB install With lithium

usb exception: [Errno None] b'libusb0-dll:err [claim_interface] could not claim interface 0, win error: Cannot create a file when that file already exists.\r\n'

update-check and title names

When you check for updates, titleNames are not shown in the server, even with command line, you sometimes get the title's baseName. I think we should get the baseName also.

I'll try to implement in my Fork after 1 week, but if you have time you could check it out.

invalid magic!

USB Connected
begin recv
read complete
invalid magic! b'/api'
failed to read!
begin recv
read complete
invalid magic! b' OF '
failed to read!
begin recv
read complete
invalid magic! b'00BD'
failed to read!
begin recv
read complete
invalid magic! b'\x00\x00\x00\x00'
failed to read!
begin recv
usb exception: [Errno None] b'libusb0-dll:err [_usb_reap_async] reaping request failed, win error: A device attached to the system is not functioning.\r\n\n'

Win 10 libusbK 3.0.70 replaced driver
switch crashed with error code: 2000-0000
Just grabbed the new commit as of right now.

Refreshing library on linux without restart

Is there a way to see newly scanned content on linux without restarting the server?

Currently I have to

  • ./nut.py --scan
  • kill the server
  • start it again

before I can see my newly added titles.

keys.txt vs Keys.txt

FYI,

CDNSP is looking for keys.txt in the cmdLine, vs Keys lib looking for Keys.txt, so unless you have both its kind of screwy :)

I know you're developing really quickly, might have missed it, loving the progress so far.

Server Authentication

Please, help me. I can't login to the server. When I start the server GUI with this command: nut.py --server and open localhost:9000 in the web browser, it wants Username and Password from me. Where I can get these information?

Thanks for your help...

Sub-dir listing

It would be nice to be able to go into sub-dirs instead of just listing the specific folder. (Like browsing through FTP/HTTP), so we can keep both the server and the switch clean. (Kept nsp for specific games within their own folder.)

Disable_game_image is ignored in config

Setting Disable_game_image | "True" in CDNSP-GUI-config.json is ignored. Images still attempt to download.

GUI Version: 6.0.1
Language Files Version: 1.0.1
OSX

OSError: [Errno 22] Invalid argument

if calc_sha256(fPath) != CNMT.parse(CNMT.ncaTypes[type])[ncaID][2]:
 File "(...)\nut\CDNSP.py", line 84, in calc_sha256
 buf = f.read(4096)
 OSError: [Errno 22] Invalid argument

Hey, I got this error.

Not downloading images from CDN

Hi

I try to scrape the images from Nintendo as seen in readme:

nut.py -s --scrape

but when finish i go to the webserver and everything looks without image,this needs some cert or token now?

thanks

Updates are not sent through usb server

So basically when I run nut.py --usb only base games and DLC are detected by tinfoil on my switch, pretty sure the updates are correctly named as they're detected when using nut.py --organize and are actually moved from my scan folder to titles/updates.

thanks!

Support to add torrent

HI, there are torrents with complete CDNSP backup that could be added to this tool and select which file you would like to download, as you can do it with utorrent for example.
Do you think is possible to add this option?. This could open this tool to widespread use

nut for network install and image scrape

So first the network install, I added a game to a directory and nut is showing it when I start the server.py however in the tutorial it says to go to locations and add location in tinfoil however I do not see a locations in order to add this, there is a locations.conf but I do not know the syntax I would need to add it manually like that.

And then image scraping, in the readme is says to use command nut.py -s --scrape however when executing this I get the message "nut.py: error: unrecognized arguments: --scrape"

Thanks for any help with these, I have a feeling the first one is me just being stupid but idk I tried for a few hours doing things but to no avail so I turn to you.

Scrape Images

Just a short question. Scraping Images. What do I get out of the pictures? 🙈 For what i need that images

Missing configuration propertyes?

In the reedme its said to:
If you only wish to rename / organize files, and not download anything, edit nut.conf and set all downloading options to false. Your NSP files should have the titleid as a part of the filename in brackets.

It can download any titles you do not have a key for (for archiving), by enabling sansTitleKey in nut.conf. These titles are saved with the .nsx file extension, and can be unlocked at a later time when a title key is found.
this options are not generated in my nut.conf, do they exist? or the download feature itself was removed?

server.py will only run once

I can run server.py and it will scan and serve just fine. But only once. When I close it and reopen it, it locks up upon trying to scan again. This is repeatable for me - and it happens with 1.2 and 1.1 and the exe file. I can fix by removing everything and extracting again.

Any ideas?

Exception: Mismatched masterKeyRevs

When trying to remove title rights from two recent publicly released NSPs, I get a "mismatched masterkeyrevs" exception (displayed masterkeyrev = 0x0). The calculated titlekey is also different from the titlekey normally obtained from said games using the rights ID.

My guess is the NSPs were reencoded on master_key_00 by the release team for maximum compatibility with all firmwares and therefore nut finds that the key used to encode the game is not the one that's supposed to be used and just stops with an exception when this happens.

Is there some way to let the script do its job despite the masterKeyRevs mismatch?
Thank you very much for the great tool!!

NCA Verification failed

Hello,
I am having an issue when manually downloading.

When I use
nut.py --download ID,KEY
It will download and fail stating "NCA Verification failed". But if I remove the key from titles.json, and use
nut.py --download ID --nsx 1
It will download the NSX fine. Once I add the key back into the file, I can successfully run an unlock command and it will add the key and convert it to an NSP.

Am I missing something, or doing something wrong?

SX Installer 1.1 Installation broken

SX Installer sends a invalid head request

192.168.188.36 - - [05/Jan/2019 17:02:58] "HEAD /api/download/01002EB007D3A000/Star%20Ghost%5B01002EB007D3A000%5D%5BDE%5D%5Bv0%5D.nsp HTTP/1.1" 200 -
192.168.188.36 - - [05/Jan/2019 17:02:58] code 400, message Bad request syntax ('GET /api/download/01002EB007D3A000/Star Ghost[01002EB007D3A000][DE][v0].nsp HTTP/1.1')

FTP/HTTP: "Couldn't resolve host" in dz

Hi,

I try to access an external HTTP or FTP ressource over WAN via domain name. But I just get: Couldn't resolve host.
From my browser everything is fine.

Is there anything I can do?

Update: FTP is also affected by this issue. Connecting over IP is working fine.

XCI Scan

Hi,

I use nut.exe v1.2 from the release section on windows.
I put xci file i made from my cartridge in the scan folder , the files are renames with [titleid] but they are not added on the server.
But the .nsp to update the game are.

Can you help ?

Thanks

Jul

Nut server with xci

Hello,
I have a sx pro and i know you released sx server, however i run my nut server in a docker on my nas and you current nut server doesn’t offer xci integration.
Do you plan to release sx server also on github so it can be started on linux and not only under windows or add the xci integration on this nut server (without on the fly conversion, just like you did on sxserver)

Read title id from nsp file?

Is it not possible to read title id, patch version etc. directly from within NSP file? As far as I know everything required to parse it is already there. So why does nut require titleid within the filename?

https support in dz?

Are you planning to add https support in dz? Maybe just use a version of curl with https support?

invalid key for a dlc?

didnt know where to report this but the title key for Overcooked! 2 [Overcooked! 2 - Surf 'n' Turf] seems to be missing 1 letter/number in its key. Its the only one that is that length and short by one. If this is the wrong place to post let me know just saw this gihub on top of the files so thought id try

Some errors in Server mode

FYI (in stdout)

Exception happened during processing of request from ('127.0.0.1', 36454)
Traceback (most recent call last):
  File "lib/Server.py", line 146, in do_GET
    method(request, response)
  File "lib/Web/Api.py", line 47, in getBannerImage
    id = request.bits[2]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/socketserver.py", line 313, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.5/socketserver.py", line 341, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.5/socketserver.py", line 354, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "lib/Server.py", line 130, in __init__
    super(NutHandler, self).__init__(*args)
  File "/usr/lib/python3.5/socketserver.py", line 681, in __init__
    self.handle()
  File "/usr/lib/python3.5/http/server.py", line 422, in handle
    self.handle_one_request()
  File "/usr/lib/python3.5/http/server.py", line 410, in handle_one_request
    method()
  File "lib/Server.py", line 150, in do_GET
    self.wfile.write(Response500(request, response))
  File "/usr/lib/python3.5/socket.py", line 594, in write
    return self._sock.send(b)
TypeError: a bytes-like object is required, not 'NoneType'

scrape not working

after"python3 nut.py -s --scrape" i get following error.

Traceback (most recent call last):
  File "nut.py", line 20, in <module>
    from nut import Title
  File "/root/nut/nut/__init__.py", line 1, in <module>
    from nut import Titles
  File "/root/nut/nut/Titles.py", line 8, in <module>
    from nut import Title
  File "/root/nut/nut/Title.py", line 16, in <module>
    from nut import Nsps
  File "/root/nut/nut/Nsps.py", line 4, in <module>
    import Fs
  File "/root/nut/Fs/__init__.py", line 3, in <module>
    from Fs.Nsp import Nsp
  File "/root/nut/Fs/Nsp.py", line 19, in <module>
    from Fs.Ticket import Ticket
  File "/root/nut/Fs/Ticket.py", line 6, in <module>
    from nut import blockchain
  File "/root/nut/nut/blockchain.py", line 222
    print(f'{last_block}')
                        ^
SyntaxError: invalid syntax

please ignore im using it with root... this is just for testing ;-)

Demo Update classification

demo_updates titles aren't being moved from updates to demo_updates, even if the "base" TID is marked as isDemo.

To reproduce:

Add to a text:

id|isDemo|region|name
0100D4E005B3E000|1|US|Mario Kart 8 Deluxe Demo

and you'll see:

organizing                                                                                                                                
/switch/base/ [0100D4E005B3E000][v0].nsp -> /switch/demo/Mario Kart 8 Deluxe Demo [0100D4E005B3E000][v0].nsp                              
/switch/updates/ [0100D4E005B3E800][v65536].nsp -> /switch/updates/Mario Kart 8 Deluxe Demo [0100D4E005B3E800][v65536].nsp 

XCI Support

Hi, this is not an issue, it is a request, but as a programmer I consider it is very easy to add this feature if you want. I'm perfectly aware that XCI is only capable for SX OS, but many people owns.
XCI does not require installation as NSP, and the procedure is finished when you retrieve from the FTP Server the XCI file and you store it into one of the next folders:

/
/sxos/xci
/switch/xci

On any of that three folders SX OS is capable to find the XCI game. So the only job is RETR the file from FTP SERVER and store it into the root folder of microSD, or /switch/xci , or /sxos/xci.

That's all.

I hope you take it in care.

Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.