Code Monkey home page Code Monkey logo

Comments (13)

vinanrra avatar vinanrra commented on May 25, 2024

Hi @JohnCMcDonough thanks for the suggestion, next thing I want to add it's the automation of mods, so people can provide URLs and the container will install the mods

from docker-7daystodie.

vinanrra avatar vinanrra commented on May 25, 2024

@JohnCMcDonough

Here it's the initial support: https://github.com/vinanrra/Docker-7DaysToDie/commits/feature/add-user-mod-download/

Still WIP

from docker-7daystodie.

vinanrra avatar vinanrra commented on May 25, 2024

@JohnCMcDonough I have tested this, and it's working, but I would like a second confirmation if possible, I'm going to release a new version v0.7.0, could you test it?, I know it's "late" but better late than never.

from docker-7daystodie.

JohnCMcDonough avatar JohnCMcDonough commented on May 25, 2024

I'll take a look at it! I don't have too many mods that aren't from nexus mods, but I'd be happy to give it a shot!

from docker-7daystodie.

vinanrra avatar vinanrra commented on May 25, 2024

They can be mods from GitHub too, they must be direct link, because I'm using curl to download

from docker-7daystodie.

JohnCMcDonough avatar JohnCMcDonough commented on May 25, 2024

Yeah, it appears to work! I'm testing now to see if we can take in nexus mods as a mod_id and file_id. As long as you have nexus premium, you can get an API key to download files. We could have a separate NEXUS_API_KEY and NEXUS_MODS env or something. We process all those first, grab the download URL from the response JSON, and append them to the list of mods to be downloaded.

The API to get the download JSON isn't too bad.

curl -X 'GET' \
  'https://api.nexusmods.com/v1/games/7daystodie/mods/$MOD_ID/files/$FILE_ID/download_link.json' \
  -H 'accept: application/json' \
  -H "apikey: $NEXUS_API_KEY"

Then RIP the first download link with a jq ".[0].URI"

from docker-7daystodie.

vinanrra avatar vinanrra commented on May 25, 2024

Yeah, it appears to work! I'm testing now to see if we can take in nexus mods as a mod_id and file_id. As long as you have nexus premium, you can get an API key to download files. We could have a separate NEXUS_API_KEY and NEXUS_MODS env or something. We process all those first, grab the download URL from the response JSON, and append them to the list of mods to be downloaded.

The API to get the download JSON isn't too bad.

curl -X 'GET' \
  'https://api.nexusmods.com/v1/games/7daystodie/mods/$MOD_ID/files/$FILE_ID/download_link.json' \
  -H 'accept: application/json' \
  -H "apikey: $NEXUS_API_KEY"

Then RIP the first download link with a jq ".[0].URI"

I will need to add a filter to check if it's a Nexus link, and more logic will check how to add it for the next versión, because my vacations are ending tomorrow😢

from docker-7daystodie.

vinanrra avatar vinanrra commented on May 25, 2024

After some checking, I will add two options:

  • Provide mod ID, file ID and download
  • Provide mod ID and download last file

from docker-7daystodie.

vinanrra avatar vinanrra commented on May 25, 2024

@JohnCMcDonough

I don't have nexus mod premium, so i'm unable to get the response.json, could you share the json of this curl?

curl -X 'GET' \
  'https://api.nexusmods.com/v1/games/7daystodie/mods/4002/files/14742/download_link.json' \
  -H 'accept: application/json' \
  -H "apikey: API_KEY"

And i will be able to support this

from docker-7daystodie.

JohnCMcDonough avatar JohnCMcDonough commented on May 25, 2024

It comes back looking like this:

[
  {
    "name": "Nexus Global Content Delivery Network",
    "short_name": "Nexus CDN",
    "URI": "https://cf-files.nexusmods.com/cdn/1059/4002/Scrollable Storage-4002-1-0-2-1-1702135378.zip?md5=65RgPxbWa9r2UN4Nlkg3IQ&expires=1702603262&user_id=<redacted>"
  },
  {
    "name": "Amsterdam (Premium)",
    "short_name": "Amsterdam",
    "URI": "https://amsterdam-premium.nexus-cdn.com/1059/4002/Scrollable Storage-4002-1-0-2-1-1702135378.zip?md5=65RgPxbWa9r2UN4Nlkg3IQ&expires=1702603262&user_id=<redacted>"
  },
  {
    "name": "Prague (Premium)",
    "short_name": "Prague",
    "URI": "https://prague-premium.nexus-cdn.com/1059/4002/Scrollable Storage-4002-1-0-2-1-1702135378.zip?md5=65RgPxbWa9r2UN4Nlkg3IQ&expires=1702603262&user_id=<redacted>"
  },
  {
    "name": "Chicago (Premium)",
    "short_name": "Chicago",
    "URI": "https://chicago-premium.nexus-cdn.com/1059/4002/Scrollable Storage-4002-1-0-2-1-1702135378.zip?md5=65RgPxbWa9r2UN4Nlkg3IQ&expires=1702603262&user_id=<redacted>"
  },
  {
    "name": "Los Angeles (Premium)",
    "short_name": "Los Angeles",
    "URI": "https://la-premium.nexus-cdn.com/1059/4002/Scrollable Storage-4002-1-0-2-1-1702135378.zip?md5=65RgPxbWa9r2UN4Nlkg3IQ&expires=1702603262&user_id=<redacted>"
  },
  {
    "name": "Miami (Premium)",
    "short_name": "Miami",
    "URI": "https://miami-premium.nexus-cdn.com/1059/4002/Scrollable Storage-4002-1-0-2-1-1702135378.zip?md5=65RgPxbWa9r2UN4Nlkg3IQ&expires=1702603262&user_id=<redacted>"
  }
]

Additionally, they actually have some swagger docs here: https://app.swaggerhub.com/apis-docs/NexusMods/nexus-mods_public_api_params_in_form_data/1.0#/

That might be a little more helpful! Or not, because I just realized they don't have their responses documented :/

from docker-7daystodie.

vinanrra avatar vinanrra commented on May 25, 2024

Thanks @JohnCMcDonough , I have been checking that document but as you pointed there aren't showing the response, so it's a bit useless if you don't have premium.

from docker-7daystodie.

JohnCMcDonough avatar JohnCMcDonough commented on May 25, 2024

Also, I'm not sure if you can grab API Keys from here without being premium.... but I just forged User-Agent: NexusApiClient/0.7.3 (Windows_NT 10.0.17134; x64) Node/8.9.3 and set my apikey: <vortex API Key>. That seemed to work.

from docker-7daystodie.

vinanrra avatar vinanrra commented on May 25, 2024

I have tested it, but because I'm not premium, I'm unable to do it (but with the above JSON I will be able to do it).

from docker-7daystodie.

Related Issues (20)

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.