Giter Site home page Giter Site logo

mccdl's People

Contributors

jkoelndorfer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

catt0

mccdl's Issues

Implement more correct modpack download behavior

Presently mccdl downloads a more recent version of a mod if it can't find a particular file ID as specified in the manifest. After some research, I found out that Curse's client is actually able to retrieve these (I used Fiddler to MITM my Curse client's traffic).

The basic mechanism is the client makes a request to https://addon-service.curse.com/AddOnService.svc, which is a Microsoft binary SOAP service endpoint (WSDL document: http://addon-service.curse.com/AddOnService.svc?wsdl).

There are some projects out there like the Curse REST Proxy that attempt to make this more accessible to non-.NET clients, but it would be nice to not need a third party service.

Another project of interest: https://github.com/khoad/msbingo

Cannot install modpacks

When I try to run it with the command:

./mccdl https://mods.curse.com/modpacks/minecraft/245163-ftb-presents-skyfactory-2-5 SkyFactory2.5

I get the following error:

INFO:mccdl.CurseForgeClient:Installing modpack 245163 in instance SkyFactory2.5, file ID latest
INFO:mccdl.CurseForgeProject:Fetching project 245163, file latest
Traceback (most recent call last):
File "./mccdl.py", line 525, in
MccdlCommandLineApplication().run(sys.argv[1:])
File "./mccdl.py", line 389, in run
action_method(project_id, file_id, args.instance_name)
File "./mccdl.py", line 73, in install_modpack
self._setup_modpack("install", project_id, file_id, instance_name)
File "./mccdl.py", line 92, in _setup_modpack
modpack_extract_dir = project.download_and_unpack_file(file_id)
File "./mccdl.py", line 142, in download_and_unpack_file
archive_path = self.download_file(file_id)
File "./mccdl.py", line 149, in download_file
file_path = self._client.downloader.download(self.file_url(file_id), destination)
File "./mccdl.py", line 279, in download
if os.path.exists(url_cache_path):
File "/home/aaron/MultiMC/mccdl-master/.venv/lib/python3.5/genericpath.py", line 19, in exists
os.stat(path)
TypeError: argument should be string, bytes or integer, not PosixPath

MultiMC version: 0.5.0-887
I have got all of the necessary python packages, and I have ran it with and without sudo

Instance setup fails if manifest.json lists nonexistent file

If the modpack manifest is busted and links to a nonexistent file, mccdl fails. This might be appropriate, but I think we can be a little more resilient. Maybe determine what files are available for the failing project and grab the next highest one?

How to reproduce:

/mccdl --modpack-file-id 2402040 yonder yonder-1.2.0

Error downloading Forge 1.7.10-10.13.4.1614

Download Project Ozone 2's current release throws an error because MultiMC's Forge configuration for that version can't be found:

% ./mccdl 'https://mods.curse.com/modpacks/minecraft/244939-project-ozone-2-reloaded' "Project Ozone 2"
INFO:mccdl.CurseForgeClient:Installing modpack 244939 in instance Project Ozone 2, file ID latest
INFO:mccdl.CurseForgeProject:Fetching project 244939, file latest
INFO:mccdl.MultiMcInstance:Creating MultiMC instance Project Ozone 2, Minecraft version 1.7.10, Forge version 10.13.4.1614
Traceback (most recent call last):
  File "./mccdl.py", line 525, in <module>
    MccdlCommandLineApplication().run(sys.argv[1:])
  File "./mccdl.py", line 389, in run
    action_method(project_id, file_id, args.instance_name)
  File "./mccdl.py", line 73, in install_modpack
    self._setup_modpack("install", project_id, file_id, instance_name)
  File "./mccdl.py", line 101, in _setup_modpack
    setup_method(*setup_args)
  File "./mccdl.py", line 437, in create
    self.configure(minecraft_version, forge_version, icon_key=multimc_icon_key)
  File "./mccdl.py", line 422, in configure
    self._configure_instance_forge(minecraft_version, forge_version)
  File "./mccdl.py", line 474, in _configure_instance_forge
    patches_dir / "net.minecraftforge.json"
  File "./mccdl.py", line 286, in download
    cached_file_path = self._download(url)
  File "./mccdl.py", line 303, in _download
    response.raise_for_status()
  File "/home/kdorf/src/mccdl/.venv/lib/python3.6/site-packages/requests/models.py", line 909, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://meta.multimc.org/net.minecraftforge/1.7.10-10.13.4.1614.json

Download of newer forge version fails/MultiMC API change

Downloading of newer forge versions fails (log at [1]). This seems to happen because MultiMC does not include forge versions 14.23.2.* in the old API (v0) at [2]. Switching to the v1 API [3] fixes this. At a glance the only API difference is the removal of "parentUid": "net.minecraft", at the beginning of the JSON.

Modifying the URL at [4] fixes this. As a test I changed the URL and downloaded a recent (Modern Skyblock 3, did not work before), an older (Project Ozone 2 Reloaded) and an old (Agrarian Skies) modpack. All but the last work, the last one fails due to a missing mod (bdlib), but forge is downloaded correctly.

[1] https://gist.github.com/catt0/4c39942989d3bc99f0fab188294b2960
[2] https://meta.multimc.org/net.minecraftforge/
[3] https://v1.meta.multimc.org/net.minecraftforge/
[4] https://github.com/jkoelndorfer/mccdl/blob/master/mccdl.py#L410

P.S. thank you for the downloader, after this fix it works where the others I tried failed!

Remove pathlib

As discovered in #5, Python 3.4 and 3.5 standard libraries don't have great integration with pathlib. It's causing more headaches than anything, so it should be nixed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.