A simple Express-based http server for redirecting download links to the latest version of a project. Can be easily self-hosted, a hosted version is available at modrinth.booky.dev.
NodeJS must be installed. If the yarn package manager is not installed, replace yarn
with .yarn/releases/*
in the following commands.
- Clone this repository
- Create a
.env
file and configure it - Run
yarn install
to install dependencies - Run
yarn run build
to build the final script - Run
yarn run start:prod
to start the web process
ROOT_REDIR
: The url to redirect to at the/
route- Default:
https://github.com/booky10/modrinth-downloader
- Default:
API_URL
: The modrinth api url. May be changed to the staging api, but should generally stay at the default value. Do not include trailing slashes!- Default:
https://api.modrinth.com
- Default:
HOST
: The host to bind on.- Default:
0.0.0.0
- Default:
PORT
: The port to bind on.- Default:
8080
- Default:
TRUST_PROXY
: Wether to trust headers sent by the client revealing the real client address. Required for rate-limiting to work correctly with e.g. Cloudflare Proxy enabled.- Default:
false
- Default:
MODRINTH_API_TOKEN
: Optional, the modrinth api token. Required for private projects to be available, otherwise not needed.- Default: none
USER_AGENT
: A user agent identifying the instance. The email address should be changed for potential contact info.- Default:
Modrinth Downloader / https://github.com/booky10/modrinth-downloader / contact@example.org
- Default:
All routes have a rate-limit of 5 requests per 30s, per ip. After this, every request will get delayed by an additional 200ms.
This just redirects to this GitHub repository, or another URL if changed.
Example: https://modrinth.booky.dev/
Redirects to the download URL of the primary file for the specified version. The response gets cached for one hour.
If you want Modrinth's JSON response instead of a redirect, set the Accept
header to application/json
or add ?json
to the query parameters.
Example (Download): https://modrinth.booky.dev/download/pyiVLk9R
Example (Json): https://modrinth.booky.dev/download/pyiVLk9R?json
Redirects to the download URL of the primary file for the latest version of the specified project. The response gets cached for 5min.
If you want Modrinth's JSON response instead of a redirect, set the Accept
header to application/json
or add ?json
to the query parameters.
Additionally, this endpoint also allows filtering of versions. Currently supported are loaders
, game_versions
and featured
. See the Modrinth API Docs for more info on how to use these.
Example (Download): https://modrinth.booky.dev/download/stackdeobf/latest
Example (Json): https://modrinth.booky.dev/download/stackdeobf/latest?json