Automatically download the newest daily build

I'm getting the same error with the latest builds. What is the last version that works with standard Java (version 8 update 311)?
 
I'm getting the same error with the latest builds. What is the last version that works with standard Java (version 8 update 311)?


Whether the downloader works for you or not, the jar you download will need something newer than Java 8.
 
Huh. OK. I had no idea Oracle's Java was so out of date. Funny how their auto updates never mention that. I hadn't downloaded a new Mafia JAR since September, so I didn't encounter the incompatibility until now. Thanks for the heads up.
 
My old Python 3 auto-update script broke down yesterday due to some issue on ci.kolmafia.us. Now that KoLmafia lives on GitHub, it made sense to tweak the script to download from GitHub instead:

SNIP

For some reason github or mafia decided to list the dmg as asset 0 in the JSON files so running this downloads the dmg instead of the jar. Tweaked the code a bit to make sure the filename has .jar in it. Might break if for some reason the asset doesn't have it, I'm very noob at programming, but:

Python:
#!/usr/bin/env python
"""Updates KolMafia"""
import json
import pathlib
import sys
import urllib.request


def main():
    """Main entry point"""
    RELEASES_URL = "https://api.github.com/repos/kolmafia/kolmafia/releases"

    print(f"Visiting {RELEASES_URL}")
    with urllib.request.urlopen(RELEASES_URL) as response:
        body = response.read().decode("ISO-8859-1")
    json_data = json.loads(body)
    json_index = 0
    while json_index < len(json_data[0]["assets"]):
        if ".jar" in json_data[0]["assets"][json_index]["name"]:
            break
        else:
            json_index += 1
            continue
    first_asset = json_data[0]["assets"][json_index]
    jar_name = first_asset["name"]
    jar_download_url = first_asset["browser_download_url"]

    if pathlib.Path(jar_name).exists():
        print(f"{jar_name} already exists.")
        return 0

    print(f"Downloading {jar_download_url}")
    CHUNK_SIZE = 1024 * 1024  # 1MB
    with urllib.request.urlopen(jar_download_url) as jar_response, open(
        jar_name, mode="wb"
    ) as jarfile:
        while True:
            chunk: bytes = jar_response.read(CHUNK_SIZE)
            jarfile.write(chunk)
            print(".", end="", flush=True)
            if len(chunk) < CHUNK_SIZE:
                break

    print("\nDownload complete!")
    return 0


if __name__ == "__main__":
    sys.exit(main())
 
I wrote a tiny script to do this from the unix command line as well -

https://github.com/mattleblanc/current-KoLMafia

Enjoy!
I updated this script for MacOS and GitHub!
 
KolMafiaUpdate hasn't been working for me since mid-June. It runs, but it no longer updates, just launches the existing version of Mafia. According to what I can glean from the logs, it no longer even detects the latest version:

Code:
---------------
6/14/2024 1:56:00 PM
KoLMafiaUpdate 1.2
Checking https://ci.kolmafia.us/ for the latest version of KoLMafia...
KoLmafia-27978.jar is the latest version
KoLmafia-27978.jar exists, you have the latest version
Running KoLmafia-latest.jar...
---------------
---------------
6/15/2024 3:47:51 PM
KoLMafiaUpdate 1.2
Checking https://ci.kolmafia.us/ for the latest version of KoLMafia...
Running KoLmafia-latest.jar...
---------------

I've re-downloaded it, but no change. Anyone have any thoughts or suggestions?
 
KolMafiaUpdate hasn't been working for me since mid-June. It runs, but it no longer updates, just launches the existing version of Mafia. According to what I can glean from the logs, it no longer even detects the latest version:

Code:
---------------
6/14/2024 1:56:00 PM
KoLMafiaUpdate 1.2
Checking https://ci.kolmafia.us/ for the latest version of KoLMafia...
KoLmafia-27978.jar is the latest version
KoLmafia-27978.jar exists, you have the latest version
Running KoLmafia-latest.jar...
---------------
---------------
6/15/2024 3:47:51 PM
KoLMafiaUpdate 1.2
Checking https://ci.kolmafia.us/ for the latest version of KoLMafia...
Running KoLmafia-latest.jar...
---------------

I've re-downloaded it, but no change. Anyone have any thoughts or suggestions?

The latest KoLMafia version is on GitHub now. Your updater is looking for it at https://ci.kolmafia.us/ . That will redirect to GitHub but it is quite likely that the updater needs to be change to find the version on the page. Since I have no idea what you are running or who is maintaining it, I have no real help other than to observe that it needs to be change to accommodate the latest version now being on GitHub.
 
KolMafiaUpdate hasn't been working for me since mid-June. It runs, but it no longer updates, just launches the existing version of Mafia. According to what I can glean from the logs, it no longer even detects the latest version...
Like fronobulax mentioned, the move to GitHub seems to have broken this auto-updater. I also used it, and I was sad when it stopped working. So I wrote a PowerShell script that serves the same purpose: https://kolmafia.us/threads/powershell-to-auto-update-kolmafia.29816/

I know, it isn't an EXE. I'm a systems engineer, not a developer. PowerShell is what I know. :) You're welcome to try it and make any suggestions that come to mind! If you need help, please post a question in that thread, and I'll try to assist you.
 
I have no idea what you are running or who is maintaining it
Thanks for the reply and explanation! I'm running KolMafiaUpdate, the subject of this topic--specifically the latest (I think) version from November of 2020, as shown in this post. It looks as if the original maintainer was matt.chugg, but I suspect that no one is maintaining it at present or someone else would have noticed when it broke a couple of months ago.

And thank you too, BigVinnie! I'll take a look at yours.
 
I make no promises about the attached file (slightly edited source plus exe), but it seems to run just fine for me using various compatibility tools on Linux.

I continue to have no real experience with C#.

(edit: this apparently lost matt.chugg's change to enable TLS 1.2 back on page 8. If for some reason you have an ancient version of the .NET runtime that might be a problem. I also updated the first post in the thread to add a bit of context and a couple of links to potentially viable alternatives.)
 

Attachments

Last edited:
Back
Top