packwiz / packwiz-installer

An installer for packwiz modpacks, with automatic auto-updating and optional mods! Works well with MultiMC and on servers.
https://packwiz.infra.link/
MIT License
46 stars 21 forks source link

Illegal character in path cause errors. #2

Closed gaycookie closed 3 years ago

gaycookie commented 3 years ago
Failed to download modpack, the following errors were encountered:
inventory-hud-forge.toml: com.google.gson.JsonParseException: Failed to parse URI
...
Caused by: java.net.URISyntaxException: Illegal character in path at index 61:
https://edge.forgecdn.net/files/3198/762/InventoryHUD-fabric-[1.16.2-1.16.5]-3.2.2.jar

inventory-hud-forge.toml

name = "Inventory HUD+"
filename = "InventoryHUD-fabric-[1.16.2-1.16.5]-3.2.2.jar"
side = "both"

[download]
url = "https://edge.forgecdn.net/files/3198/762/InventoryHUD-fabric-[1.16.2-1.16.5]-3.2.2.jar"
hash-format = "murmur2"
hash = "3155476420"

[update]
[update.curseforge]
file-id = 3198762
project-id = 357540
release-channel = "beta"

Dear developers.

I stumbled on an error that kind of prevents me from using this module of Packwiz with my modpack When I try to make it download the mods, it always errors on this exact same mod. I do not know what I can do about it or if there is a way around it?

Greetings

comp500 commented 3 years ago

Currently there's some issues with how packwiz-installer handles square brackets in URLs, a fix is planned but for now you can do the following workaround:

For the file you gave above that would be:

name = "Inventory HUD+"
filename = "InventoryHUD-fabric-1.16.2-1.16.5-3.2.2.jar"
side = "both"

[download]
url = "https://edge.forgecdn.net/files/3198/762/InventoryHUD-fabric-%5B1.16.2-1.16.5%5D-3.2.2.jar"
hash-format = "murmur2"
hash = "3155476420"

[update]
[update.curseforge]
file-id = 3198762
project-id = 357540
release-channel = "beta"
gaycookie commented 3 years ago

Thank you very much for your quick reply

Stupid of me to not think about changing the special characters in the URL itself. Everything works flawless now! 😄

Panderine commented 2 years ago

I'm having the same issue with the same mod. Adding the mod creates the following toml file:

name = "Inventory HUD+"
filename = "InventoryHud_[1.18].forge-3.4.4.jar"
side = "both"

[download]
url = "https://edge.forgecdn.net/files/3565/981/InventoryHud_%5B1.18%5D.forge-3.4.4.jar"
hash-format = "sha1"
hash = "3894111fa176a41dccead20e605030c533028a3a"

[update]
[update.curseforge]
file-id = 3565981
project-id = 357540

But then it fails to download with the packwiz-installer

EDIT: missed the filename part, only did the url. With both changes it works.