-
Notifications
You must be signed in to change notification settings - Fork 0
Downloader
The purpose of the Downloader is to download mods from Nexusmods, upload them and modify the state of the database accordingly.
-
Ensure Rclone is in your PATH
-
Setup a remote for Nexusmods in Rclone
-
Obtain one or more Nexusmods API keys from https://www.nexusmods.com/users/myaccount?tab=api. Use the field named
Personal API Key. If you wish to use more than one API key to avoid ratelimiting delays, you must register multiple Nexus accounts. Each account requires a unique email address. -
Duplicate the file
settings.example.jsonfrom the repository root and rename itsettings.json. This is where all your credentials will be stored (the filenamesettings.jsonhas been added to.gitignore). Fill in the fields as follows (if you are only using one Nexus API key, leave it in the array anyway):{ "endpoint": "https://www.tdpain.net/nexusapi/", "auth_key": "put your internal auth key here", "game": "skyrim", "download_folder": "downloads", "nexus_keys": [ "put your nexus api keys in this list here" ], "rclone": { "remote_name": "target rclone remote", "directory": "downloads", "show_progress": false } }endpointandrclone>directoryshould remain unchanged. -
Run the downloader. For the first mod the script tries to download, it will ask you what download server to use. After each run, you should check the
error.logfile the script creates to check if the script stopped prematurely, and if so, why.
download.py is the script you want to run for this. If begins by defining some functions, initialising Loguru, loading settings and initialising the key switcher.
It then begins the download sequence. It will make a request to the internal API, and depending on the response, wait for 30 seconds, or move on to downloading the file. If it moves on, the download link is requested from Nexus, and downloaded. While downloading, it is compressed and when the download is completed, uploaded to the specified remote using Rclone. Once this has been done, the internal API is informed the download has succeeded, and the sequence restarts.
common.py is just used for some fancy coloured printing.