ROM Hack RELEASE GDrive Token Generator for SX Installer (Authenticated Google Drive Support)

Arkangelshadow

Well-Known Member
Member
Joined
Jun 6, 2013
Messages
151
Trophies
1
Age
38
XP
1,455
Country
Mexico
Thx, everything worked fine as I have access to the files via "mounting" the google drive folder; but it takes too long to load, and it didn't tell me which games require updates or dlc.
 

lahma

Member
OP
Newcomer
Joined
Nov 29, 2017
Messages
24
Trophies
0
XP
231
Country
United States
Thx, everything worked fine as I have access to the files via "mounting" the google drive folder; but it takes too long to load, and it didn't tell me which games require updates or dlc.
I'm not sure what you mean by "mounting" the Google Drive folder (do you mean the "File Browser"?). When I load Tinfoil (without connecting to a NUT server), it only takes a few seconds to parse my Google Drive folder. I have my gdrive path set directly to the folder containing only my Switch files though, so even though my Switch folder has many hundreds of NSPs/XCIs/etc, it only has to parse those files and not everything else on my Google Drive. If you want Tinfoil to parse your gdrive path on startup (so that it can be used in the list of new games/updates/dlc), highlight it inside of "File Browser", hit "X" on your controller, set ENABLED to 'YES', and then hit "X" again to save. If ENABLED is set to 'NO', then Tinfoil does not parse the directory at all upon startup and the only way to access the files within is directly through "File Browser".

Another thing to be aware of is if you have ENABLED set to 'YES' on a location that is inaccessible (such as a 'nut://' address but you do not have your NUT server running), it will take a very long time for Tinfoil to startup because it is trying to access that address but can't. The timeout value for how long it continues to try to access an inaccessible address can be changed but its probably best just to set the ENABLED value appropriately for all of your locations instead.

One thing I'm not sure of is how Tinfoil parses Switch files on Google Drive. While it may actually read the header of each file in order to ascertain the title id and version # of each, it parses my gdrive folder so quickly that I doubt whether this is actually the case. If I had to guess, I would say that it is instead reading that info from the filename of each file instead. If this is indeed the case (perhaps @blawar can answer this), then you will need to ensure that you have all of your Switch files on your Google Drive are named appropriately (such as 'Celeste [01002b30028f6800][v196608].nsp') so that it can correctly parse them to use them in the New Games/Updates/DLC sections.

Hopefully I was able to answer your question. If I misunderstood, please clarify what you need help with, and I'll do my best to help out.
 

Arkangelshadow

Well-Known Member
Member
Joined
Jun 6, 2013
Messages
151
Trophies
1
Age
38
XP
1,455
Country
Mexico
Hi, thx for your answer. I'm using SX Installer; and by "mounting the gdrive" i'm refering to the file browser.

I went to the file browser, and i was already enabled. The file browser is pointed to a folder in the gdrive that has 3 subfolders (base,dlc,updates).

If i click on dlc, it takes a large amount of time before it can show me files; wich i can now order (thx to you) but can't know if i have it installed or not.

But the gdrive files only appear via file browser; and not on the left menu as in some "packs".
 

lahma

Member
OP
Newcomer
Joined
Nov 29, 2017
Messages
24
Trophies
0
XP
231
Country
United States
Hi, thx for your answer. I'm using SX Installer; and by "mounting the gdrive" i'm refering to the file browser.

I went to the file browser, and i was already enabled. The file browser is pointed to a folder in the gdrive that has 3 subfolders (base,dlc,updates).

If i click on dlc, it takes a large amount of time before it can show me files; wich i can now order (thx to you) but can't know if i have it installed or not.

But the gdrive files only appear via file browser; and not on the left menu as in some "packs".
Obviously, I'm a bit late here lol... Sorry, I didn't even see that I had a reply on the thread. As far as having the gdrive files show up in the left menu, you can now "Pin" any gdrive directory and those files should show up there. Just browse to the Google Drive folder you desire and push in/click the right stick (I think.. it should say at the bottom of the screen) and it should accomplish what you're trying to do.

On the newest version of Tinfoil (7.01), I'm experiencing some other issues with gdrive paths that I contacted @blawar about (such as having issues using folder IDs as the 'path' and also issues using raw path labels as 'path' that are pointing to folders containing lots of files, ex: 'root/switch/games'). Whenever I hear back from him, I will update the thread as well as the instructions on my Github.

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

This works very well, thank you for the very readable guide!
You're very welcome! Took me a lot of trial, error, and heartache to figure it all out, so I felt compelled to share my findings with others :) Glad you found it useful.
 

eXhumer1

Member
Newcomer
Joined
May 1, 2019
Messages
7
Trophies
0
XP
137
Country
Canada
I have a few questions.

Why have you opted for oauth2client, a deprecated oauth2 python library instead of the ones mentioned in the deprecation notice?
Why have you not used the same methods outlined in nut for token creation and the oauth library used in nut instead of making your own methods and using deprecated oauth library?

https://pastebin.com/bf8Fx2up

EDIT: Also forgot to ask another question, why are you building a Google Drive service for, returning it with your method and not using it anywhere?
EDIT2: Also forgot to ask another question, why is your scope read-only? IIRC (although I could very well be wrong here), you can also write to the gdrive protocol in tinfoil/sx-installer. So, I'm not sure why you did that for also.
 
Last edited by eXhumer1,

lahma

Member
OP
Newcomer
Joined
Nov 29, 2017
Messages
24
Trophies
0
XP
231
Country
United States
I have a few questions.

Why have you opted for oauth2client, a deprecated oauth2 python library instead of the ones mentioned in the deprecation notice?
Why have you not used the same methods outlined in nut for token creation and the oauth library used in nut instead of making your own methods and using deprecated oauth library?

https://pastebin.com/bf8Fx2up

EDIT: Also forgot to ask another question, why are you building a Google Drive service for, returning it with your method and not using it anywhere?
EDIT2: Also forgot to ask another question, why is your scope read-only? IIRC (although I could very well be wrong here), you can also write to the gdrive protocol in tinfoil/sx-installer. So, I'm not sure why you did that for also.
I already replied to the issue you filed on my Github. I will try to reply to your other questions here when I get a chance. Just a bit busy at the moment. (Quick Hint: Lots of things have changed in Tinfoil since I wrote the utility and all its documentation... Tinfoil used to only support reading from GDrive (no save support to gdrive) and you could only create the initial authentication token while being connected to a PC via NUT.)
 
Last edited by lahma,

blawar

Developer
Developer
Joined
Nov 21, 2016
Messages
1,708
Trophies
1
Age
40
XP
4,311
Country
United States
I already replied to the issue you filed on my Github. I will try to reply to your other questions here when I get a chance. Just a bit busy at the moment. (Quick Hint: Lots of things have changed in Tinfoil since I wrote the utility and all its documentation... Tinfoil used to only support reading from GDrive (no save support to gdrive) and you could only create the initial authentication token while being connected to a PC via NUT.)

Your app is still useful when the user doesn't want to use NUT or manually create the required files on a PC.
 

lahma

Member
OP
Newcomer
Joined
Nov 29, 2017
Messages
24
Trophies
0
XP
231
Country
United States
Your app is still useful when the user doesn't want to use NUT or manually create the required files on a PC.
Hey @blawar , I sent you a PM a couple of days ago but I'm going to repeat my msg/questions here in case someone else has input on the topic or can answer any of my questions. If/when you have time to address any of this, your input would be greatly appreciated.

Just have a quick question (or maybe observation) about Google Drive support in the latest version of Tinfoil (v7.01). On the previous version, when you were adding a Google Drive path, you could put the folder ID of any folder on your gdrive as 'path' and it would work just fine. Now, that does not appear to be working... which would be fine if a normal raw path worked (which it does appear to work to some extent) but it appears that something funny is going on. For example, if I add a new gdrive location with no path, it opens it just fine. If I add one with the path set to 'root', it opens up to the root "My Drive" folder perfectly fine (and opens it almost immediately). However, if I start doing my fine-grained paths than that, I start getting very strange behavior.

Just as an example, my gdrive has a valid path of "root/temp" (and the temp folder has just a few files in it), but if I put that in as my path, it appears to completely lock up the app. However, just by accident, I left it sitting there in that locked state for probably 5-10 min, and eventually, it actually did open that folder. That got me curious, so I tried pointing it to the raw path of my Switch Games directory once again (in my case "root/backup/Switch Games") and again it appeared to freeze... I left it like that for probably 40 min and it never did open the folder. That folder has 100's of GBs of Switch games, but it opened it very quickly on the previous version (even though I was using a folder ID instead of the raw path). All of these paths have 'Enabled' set to 'False' and none of them are pinned.

In the big spectrum of things, none of this is a huge deal as I can just navigate to my Switch Games directory from gdrive location with a blank path... I'm mostly trying to figure all of this out so I can update my project documentation since a lot of it is no longer valid (since raw folder IDs appear to no longer be working). I also have a lot of people contacting me to ask for help figuring out why their gdrive paths are not working in Tinfoil/SX Installer.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • The Real Jdbye @ The Real Jdbye:
    the vram is one advantage when it comes to AI but ends up being slower even with that and really AI is the only use case that needs more than 12gb vram right now
  • Psionic Roshambo @ Psionic Roshambo:
    Interesting lol
  • Psionic Roshambo @ Psionic Roshambo:
    I think I watched a video where two games at 4K where eating just over 16GB of RAM and it's the one case where the 7900XT and XTX pulled ahead (minus RTX of course)
  • Psionic Roshambo @ Psionic Roshambo:
    So my opinion is that they could age a bit better in the future, and maybe AMD will continue improving them via drivers like they tend to do. No guarantee there but they have done it in the past. Just a feeling I have.
  • The Real Jdbye @ The Real Jdbye:
    cyberpunk at 4k without DLSS/fidelityfx *might* exceed 12gb
    +1
  • The Real Jdbye @ The Real Jdbye:
    but that game barely runs at native 4k
  • Psionic Roshambo @ Psionic Roshambo:
    I think it was some newer games and probably poorly optimized PS4 or PS5 ports
  • The Real Jdbye @ The Real Jdbye:
    they definitely will age better but i feel dlss might outweigh that since it looks about as good as native resolution and much less demanding
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    When I played Cyberpunk on my old 2080 Ti it sucked lol
  • The Real Jdbye @ The Real Jdbye:
    AMD could introduce something comparable to DLSS but nvidia's got a lot more experience with that
  • The Real Jdbye @ The Real Jdbye:
    least amd 7xxx has tensor cores which the previous generations didn't so there is the potential for AI upscaling
  • Psionic Roshambo @ Psionic Roshambo:
    They have FSR or whatever it's called and yeah it's still not great
  • The Real Jdbye @ The Real Jdbye:
    so AMD seem to finally be starting to take AI seriously
  • Psionic Roshambo @ Psionic Roshambo:
    Oh yeah those new 8000 CPUs have AI cores built in that's interesting
  • Psionic Roshambo @ Psionic Roshambo:
    Maybe they plan on offloading to the CPU?
  • Psionic Roshambo @ Psionic Roshambo:
    Would be kinda cool to have the CPU and GPU working in random more
  • Psionic Roshambo @ Psionic Roshambo:
    Tandem even
  • The Real Jdbye @ The Real Jdbye:
    i think i heard of that, it's a good idea, shouldn't need a dedicated GPU just to run a LLM or video upscaling
  • The Real Jdbye @ The Real Jdbye:
    even the nvidia shield tv has AI video upscaling
  • The Real Jdbye @ The Real Jdbye:
    LLMs can be run on cpu anyway but it's quite slow
  • BakerMan @ BakerMan:
    Have you ever been beaten by a wet spaghetti noodle by your girlfriend because she has a twin sister, and you got confused and fucked her dad?
  • Psionic Roshambo @ Psionic Roshambo:
    I had a girlfriend who had a twin sister and they would mess with me constantly.... Until one chipped a tooth then finally I could tell them apart.... Lol
  • Psionic Roshambo @ Psionic Roshambo:
    They would have the same hair style the same clothes everything... Really messed with my head lol
  • Psionic Roshambo @ Psionic Roshambo:
    @The Real Jdbye, I could see AMD trying to pull off the CPU GPU tandem thing, would be a way to maybe close the gap a bit with Nvidia. Plus it would kinda put Nvidia at a future disadvantage since Nvidia can't make X86/64 CPUs? Intel and AMD licensing issues... I wonder how much that has held back innovation.
    Psionic Roshambo @ Psionic Roshambo: @The Real Jdbye, I could see AMD trying to pull off the CPU GPU tandem thing, would be a way to...