Latest edit at 2021/04/18 (yyyy/mm/dd). May be outdated. Don’t forget to use your brain.
Just a place to put all copypasta together. This document is in no way a full guide. Not even a comprehensive one. It’s just a collection of things that are missing in READMEs or are easily glanced over. It does not replace any READMEs. It does not have replacing any README as a goal. It isn’t likely to replace any README in the future.
If you want to have access to the game collection in your Tinfoil you’ll need to follow uncertain number of following steps in some combination.
Get a google drive of big enough size (“big enough size” means “5TB if you heavily filter the copy, 10+ if you don’t”). You can ask in #google-drive-questions
for advice on getting one, or maybe someone will pin some info.
!cmd
chat command). If you manage to get shared drive somewhere - it should be configured as “team drive” as well (first half of the guide). Or you can invoke rclone config create <remote_name> drive team_drive <drive_id> scope "drive"
(substituting <remote_name>
and <drive_id>
with correct values, of course) and select google account when browser pops up, if you want to reduce the number of steps in configuring it. drive_id
being the part of URL after https://drive.google.com/drive/folders/
when you open your shared drive. Don’t forget the --drive-server-side-across-configs
flag.!cmd
chat command).!tinfoil
chat command. At the time of writing there are two indexers available:
BigBrainAFK/tinfoil_gdrive_generator
(runs on Node.js).DevYukine/rustfoil
written in Rust. Intended to have no need in external dependencies. Documentation is somewhat barebones. Somewhat step-by-step guide available here.eXhumer/TinGen
(runs on Python 3.6+).You should follow the README of the indexer you choose to make it work. The one advice i want to provide is to encrypt the index file (tinfoil_gdrive_generator
would do it by default, TinGen
needs you to add --encrypt
flag to its invocation).
Be aware that index needs to be regenerated every time files on the drive change. If you have automated the cloning - i recommend to automate index generation to run after that (i.e. on the next line of the batch file).
Here the path splits again:
credentials.json
and gdrive.token
from index generator folder into <SDROOT>/switch/tinfoil
folder. It will give Tinfoil credentials to authenticate.gdrive:
and empty path. It will make Tinfoil use said credentials at startup.BigBrainAFK/tinfoil_gdrive_generator
add -auth
flag to the invocation.eXhumer/TinGen
add --share-files
flag to the invocation.DevYukine/rustfoil
you have --share-files
that shares each file, and --share-folders
which shares whole folders instead (Pro: way faster, as you need to do 1 share per folder, than thousands of files, Contra: there would exist a gdrive link that would allow non-authorized user to list all of your files in the folder. Similar thing can be achieved for other indexers by manually sharing the folders (setting the access to “Anybody with link”))..tfl
extension and put it onto your SD into the folder that’s indexed by Tinfoil. By default - root of SD and <SDROOT>/switch/tinfoil
folders work. Easiest way to setup once, but updating the index file on your SD can become tedious.http:
(or https:
), address, port, path pointing to the index. Username/password pair can be used if your HTTP(HTTPS) server is configured to provide basic authentication. Arguably, the most hard/involved way, but if you already have, say, VPS or something - you can run HTTP server and rclone on it and this whole setup can be made to work automatically.--upload-to-my-drive --share-uploaded-index
flags to TinGen invocation (or --upload-my-drive --share-index
for rustfoil, or -uploadDrive y
for tinfoil_gdrive_generator). It will result in index being uploaded to drive and shared to “Everyone with link”. TinGen will also give you the index link in form of https://drive.google.com/uc?id=IdGoEsHeRe
https://drive.google.com/uc?id=IdGoEsHeRe
) with tiny.cc or something. Reason: sadly, Tinfoil doesn’t support indexes hosted at google drive directly. Also, it wouldn’t hurt to check if index file is succesfully shared on your drive.https:
and address/path being the shortened url you got.After you finished that branchy path you’ll hopefully see New Games/New Updates/New DLC tabs populated in your Tinfoil and downloads working.
rclone sync
vs rclone copy
. The difference is: copy
would check each file present on source remote and make copy of it on target remote (skipping the ones that are already present). sync
would make the target remote look exactly like the source one. Including renaming/deleting files. Given that indexers don’t sort/filter, say, updates - sync
is more convenient for the “my-own-shop” usage. On the other hand, if you want to store the older files (say, updates. Again.) - copy
would be the way to go.--track-renames
flag recommended by the rclone guide only works with rclone sync
and will actually produce an error while used with rclone copy
. The error doesn’t prevent the rclone from working, but to get rid of it either use sync
with this flag, or copy
without it.--drive-stop-on-upload-limit
flag may be added to rclone invocation to make it exit when reaching 750 GB daily limit. Without this flag rclone will stay active until (i assume, never tested that) the quota gets lifted. Or you close the software with Ctrl-C or something.-P
flag may be added to rclone invocation to make it show the progress of operations. Or not added if you run it automatically/unattended and don’t need the output.--exclude
flag allows to filter files out (i.e. exclude certain languages. Or blacklist certain games). Multiple --exclude
filters can be added to the same invocation. Search #google-drive-question
channel for rclone --exclude
to get some examples from other users.--delete-excluded
goes with sync
and --exclude
. It makes rclone delete files filtered out by --exclude
from the target drive. I.e. it’s useful if you decide to add a filter after you already have some files copied.--exclude "*\[{JP,KR,GB,HK,RU,PL,AU,FR}\]*"
; `–include “\W{US,USA,GB,EU,World,En,Europe}\W”.rclone size
is the command to check the size of something (duh). Can be used together with --exclude
filters and source folders you intend to use to get an idea of how much space the final copy would take.rclone ls/lsf/lsjson
provide a list of files in case you need it.Index can be made to include non-switch files. That would be useful to provide, say, game saves. Or ROMs for emulation. Or whatever another use you can find. Can’t say more, never tried that myself.
If you have some files on your local PC/home server and want to setup network install - Tinfoil is smart enough to get the file links from most indexes automatically created by various HTTP servers (i.e. python -m http.server
). This way is likely to not work with full (and even just full-ish) collection as the big number of files may cause Tinfoil to not work properly.
You can make Tinfoil index some other directory other than root of SD and <SDROOT>/switch/tinfoi
(not that there is a big need for that). To make that happen create a new source in the File Browser tab of Tinfoil with protocol sdmc:
and Path being the name of the folder (i.e. /secretstuff/indexhere/
).
Getting a custom client ID for use with Google Drive. I didn’t see any profit from it while trying to run it. I haven’t seen problems that could be solved by it. Don’t ask me what is it for.
Sharing the index with another people. It is OK. But if your files are not published - remember that credentials.json
+ gdrive.token
give full priveleges of account they were created with. So consider creating a throwaway account with read permissions granted on your drive to provide to another users. Or let them make their own credentials/token pairs (may use another tools, like GDrive Token Generator for SX Installer
or whatever) and give their google accounts the read permissions.
https://blawar.github.io/tinfoil/custom_index/
https://blawar.github.io/tinfoil/network/
READMEs of tools you use
Step-by-steps for: