~moviuro/factorio-dl

Factorio downloader script for UNIX(-like) systems
21245f73 — Moviuro 9 months ago
factorio-dl: add support for email OTP
73cfbe20 — Moviuro 9 months ago
factorio-dl: loop until we get a password; enhance help text
a4a68066 — Moviuro 9 months ago
factorio-dl: remove redundant code (version number grabbing from API)

clone

read-only
https://git.sr.ht/~moviuro/factorio-dl
read/write
git@git.sr.ht:~moviuro/factorio-dl

You can also use your local clone with git send-email.

#Factorio-DL

#Jumpstart

This (more-or-less) POSIX-compliant shell script will download the specified Factorio version for a target platform.

% ./factorio-dl -l login -p password -t linux64 0.16.12
% ./factorio-dl -il login -t osx 0.15.40

#Configuration

This shell script will use your player-data.json file if it exists. On Linux or macOS, you probably don't need to do anything. On WSL, specify a path to that file with -y if the default behavior doesn't cut it.

If player-data.json file does not exist or does not contain the necessary data, try -il YOUR_LOGIN.

See factorio-dl -h for more help.

#Archlinux-specific

#Integration to makepkg.conf(5)

Add the DLAGENT to your makepkg.conf(5):

DLAGENTS=([...]
+         'factorio::/usr/bin/factorio-dl -t linux64 -o %o %u'
          [...])

Use the factorio:// URL scheme in the PKGBUILD:

source=(factorio_alpha_x64_$pkgver.tar.xz::factorio://$pkgver
        factorio.desktop
        LICENSE)

This will cause makepkg(1) to invoke the following command, which happens to do exactly what we expect it to do!

% /usr/bin/factorio-dl -t linux64 -o factorio_alpha_x64_$pkgver.tar.xz factorio://$pkgver

#Magical PKGBUILD

We can use the PKGBUILD to temporarily add a DLAGENT:

DLAGENT+=('factorio::/usr/bin/factorio-dl -t linux64 -o %o %u')
source=("factorio_alpha_x64_$pkgver.tar.xz::factorio://$pkgver")

There is an example of a PKGBUILD using this technique.

#Bugs?

Open an issue, append the output of the offending command, with the -d switch added to the command line. Make sure to hide your credentials.