sammko / picomc

A tiny CLI Minecraft launcher
MIT License
65 stars 6 forks source link

Installing modpack from FTB fails on `KeyError: 'url'` #29

Open Zajozor opened 1 year ago

Zajozor commented 1 year ago

Trying to install https://feed-the-beast.com/modpacks/96-ftb-plexiglass-mountain

(base) zajo@zor-awakened ~ % picomc mod pack ftb install 96
/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.12) or chardet (3.0.4) doesn't match a supported version!
  warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
INFO Installing FTB Plexiglass Mountain 1.2.2 as FTB_Plexiglass_Mountain-1.2.2
INFO Fetching Forge metadata
INFO Resolving version
INFO Installing Forge 1.18.2-40.1.84 as 1.18.2-forge-40.1.84
WARNING As the Forge project is kept alive mostly thanks to ads on their downloads
WARNING site, please consider supporting them at https://www.patreon.com/LexManos/
WARNING or by visiting their website and looking at some ads.
INFO Downloading installer
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00,  1.78s/it]
INFO Installing with PicoForgeWrapper
INFO Done installing Forge
WARNING Skipping unsupported target java
Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniconda/base/bin/picomc", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/picomc/__init__.py", line 18, in main
    picomc_cli()
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  [Previous line repeated 1 more time]
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/picomc/cli/utils.py", line 16, in wrapper
    fn(x, *a, **kwa)
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/picomc/mod/ftb.py", line 155, in install_cli
    install(pack_id, version, launcher, im, name, use_beta=beta)
  File "/opt/homebrew/Caskroom/miniconda/base/lib/python3.8/site-packages/picomc/mod/ftb.py", line 122, in install
    dq.add(f["url"], filepath, f["size"])
KeyError: 'url'

MacOS, M1

click                   8.1.3
picomc                  0.4.5

I suppose the urllib warning at the top isn't critical but also a bit annoying as it's present with every picomc command. Let me know what else I can provide :) !

sammko commented 1 year ago

The urllib warning is probably due to miniconda shipping weird versions of packages. I'd recommend using a vanilla python distribution (brew install python3), potentially even with something like pipx. I'll have a look at the API issue soon

sammko commented 1 year ago

So basically FTB stopped providing download URLs for some files and instead provides curseforge project and file IDs. The curseforge API has been replaced in the meantime as well, so that needs to be fixed first. At least it seems to have documentation this time. https://docs.curseforge.com/#getting-started