modpack-installer icon indicating copy to clipboard operation
modpack-installer copied to clipboard

Wrong url for forge download

Open herrlockskun opened this issue 2 years ago • 1 comments

[OS] Ubuntu 22.04

Minecraft install via snap

I had an issue with the version 2.4 of  GT new horizons The link to download forge was worng

reating .minecraft directory
Creating symlinks
Installing modloader
Updating user launcher profiles
Downloading https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.7.10-10.13.4.1614/forge-1.7.10-10.13.4.1614-installer.jar
Got 404 error trying to download Forge
Downloading https://adfoc.us/serve/sitelinks/?id=271228&url=https://maven.minecraftforge.net/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/forge-1.7.10-10.13.4.1614-1.7.10-installer.jar
Traceback (most recent call last):
  File "/home/herrlockckun/modpack-installer/install.py", line 393, in <module>
    main(
  File "/home/herrlockckun/modpack-installer/install.py", line 243, in main
    modloaders[modloader].main(manifest, mcver, mlver, packname, user_mcdir, manual)
  File "/home/herrlockckun/modpack-installer/forge_install.py", line 46, in main
    resp = download(url, outpath, True)
  File "/home/herrlockckun/modpack-installer/util.py", line 33, in download
    size = int(r.headers['Content-Length'])
  File "/usr/lib/python3/dist-packages/requests/structures.py", line 54, in __getitem__
    return self._store[key.lower()][1]
KeyError: 'content-length'

the format of the url appear to be mcver + mlver + mcver and not mcver + mlver. So i changed line 33 of forge_install.py from forge_fullver = mcver + '-' + mlver to forge_fullver = mcver + '-' + mlver + '-' + mcver And this work for me.

herrlockskun avatar Nov 25 '23 13:11 herrlockskun

If I remember right, the format is not consistent across different versions of Forge. I can check if that's what's happening. In any case, the fallback option should not be trying to use an adfocus link.

cdbbnnyCode avatar Nov 25 '23 16:11 cdbbnnyCode

I have not fully tested it, but this should be resolved in f6aa4ea.

cdbbnnyCode avatar Apr 15 '24 19:04 cdbbnnyCode