• Register
Forum Thread
  Posts  
How to download mod addon via code (Forums : Support : How to download mod addon via code) Locked
Thread Options
Jul 30 2017 Anchor

Hello everyone,

I am working on a mod for a game called Might and magic heroes V. The mod will feature bundles with additional fan made creatures. There will be numerous bundles (each bundle is a .rar file) where the user will need only one of them at a time. For that reason I have created a small application that manages bundles a.k.a. NCF configuration utility.

What I would like to do is to let the user download addons from moddb from within the app.

For example - when the creature bundle is in globally shared with dropbox, I managed to download it automatically from there with the application.
Here is the order of HTTP communication(ruby code but the idea should be the same for any language):

uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(uri.request_uri) ## making the request toward the Dropbox file shared URL
resp = http.request(request) ## geting the response
real_url = http.request(request)['location'] ## extracting a new URL from the response which is actually the real URL to the file
download real_url ##Downloading the file using the real url

My question is how to make this working with moddb ? The method above does not work because moddb way of managing files is a bit different.

First you click on the download which opens a new window which then sends the redirected DL link.
How do I get it? what is the order of http commands?

Thank you :)

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.