Comments (7)
Same with title ID 0005000e1010f500.
from funkiiu.
I've just done:
wget http://ccs.cdn.wup.shop.nintendo.net/ccs/download/0005000e10112200/00000001
and
wget http://ccs.cdn.wup.shop.nintendo.net/ccs/download/0005000e1010f500/00000001
and in both cases the file is size 32784. In other words, that seems to truly be the file size on the CDN, so your code isn't downloading it wrongly. The problem seems to be that the TMD says it is 32769 which doesn't match, assuming your code is reading the TMD correctly. I haven't checked the TMD parsing separately.
So the question is, what is the correct thing to do in this case? You could truncate the file to match the size the TMD says (or only download the first X bytes based on what the TMD says). Or you could just not bother checking the file sizes, maybe as an optional switch?
from funkiiu.
The file size mismatch problem has been discussed in https://gbatemp.net/threads/funkiiu-incompatibility-with-0005000e10102100-nintento-land-update.464552/ where it has been pointed out that the file size in the TMD is the file size of the decrypted content, not the encrypted content downloaded from the CDN. When decrypted, the file sizes are correct apparently, although I realise that FunKiiU doesn't do decryption so cannot verify that.
https://gbatemp.net/threads/funkiiu-verify-function-to-list-all-incompatible-game.464904/ has a modified version of your code with a nosizecheck parameter which would help with these awkward files.
Arguably, though, you shouldn't be using the TMD to verify sizes of downloaded encypted content at all, in other words, nosizecheck should be the default state, even though the size check does help detect incomplete downloads.
Tricky to know what to suggest, other than adding decryption as a verification step.
from funkiiu.
Thanks, I never knew this problem. I'll see what we can do.
But no decryption :)
from funkiiu.
I said previously that a "no size check" mode should be the default, as it would be more "correct", based on the principal that the size in the TMD isn't actually what one thinks it is.
Thinking about this further, given that 99% of titles have sizes in the TMD which do match the encrypted file sizes, I now think it actually would be good to check the sizes (to detect partial downloads) by default.
The question then is what to do about the titles with incorrect sizes in the TMD.
Maybe you could detect this at runtime, e.g. if after N download attempts the file size is wrong (but consistently wrong to the same size each time), go into a "no size check" mode.
Alternatively you could have a hardcoded list of title IDs with incorrect sizes, and use that to go into the different mode. Or try and persuade the titkekey site to store a flag against the title ID in their database, exposed via the JSON.
It might be worth bearing in mind that presumably the incorrect TMDs may be fixed by Nintendo in future, at least for patches and DLC if not for base titles, so a "blacklisted" title ID might not stay like it forever.
from funkiiu.
In light of the recent discontinuation of Wii U USB Helper, is there any likelihood that this issue could get re-explored?
It seems the downstream developers are aware of this issue too: https://github.com/dojafoja/FunKii-UI/issues/4
from funkiiu.
You can get the correct size with code like this (inside of download_file) but that's quick&dirty / there might be a way without opening two connections to the NUS (but I also can't re-use the connection reading the content-length as that would destroy download resuming).
infile = urlopen(url)
cl = infile.headers['Content-Length']
if cl == None:
expected_size = None
else:
expected_size = int(cl)
infile.close()
from funkiiu.
Related Issues (20)
- Force all and any updates to get ticket from Nin?
- If information about an update exists in the json, use it.
- 0005000010131d00 - japanese title, breaking program HOT 2
- Run in background error? HOT 8
- Unknown character stops all downloads HOT 10
- Query: Execute on Android / QPython options. HOT 3
- Add newline before printing "Download complete" HOT 7
- chunk_size=0x4096 strange? HOT 1
- The keysite changed its url HOT 2
- aaaa.bbbbbbbbb.ccc has been changed, please update HOT 1
- Allow resuming download? HOT 4
- Memory leak within download_file() HOT 5
- Updated title key website website location HOT 2
- Typo
- Not working! HOT 3
- FunKiiU Suddenly Stops Working HOT 2
- Case (in)sensitivity on config-saved keysite URL. HOT 1
- the key was wrong HOT 1
- the key site don't exist anymore HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from funkiiu.