Mod Portal Upload API Docs (for VSCode Extension)

A place to talk about the official Factorio mod portal (https://mods.factorio.com)
Post Reply
justarandomgeek
Filter Inserter
Filter Inserter
Posts: 300
Joined: Fri Mar 18, 2016 4:34 pm
Contact:

Mod Portal Upload API Docs (for VSCode Extension)

Post by justarandomgeek »

I've just noticed the portal update broke my mod uploader (in the vscode mod debugger extension), and thought I might as well ask for some real docs/support this time before i start reverse engineering again to update it!

Is there (or can there be) a documented API way to get logged in for uploading, rather than scraping the login page for a form to submit? Ideally I'd love to just have you generate an oauth token (or equivalent) that can be copied into vscode for me to use, rather than having to handle user credentials directly. Can I use the service-token somehow for uploading mods?

Also, I previously only supported uploading updates to existing mods because there was no way for me to test (and thus reverse engineer) uploading new mods without spamming a ton of new mods on the portal (I keep the update testing contained/hidden by using a deprecated mod, jargtestmod). I would love some kind of "dummy" empty clone of the portal that just deletes uploaded mods after a while (an hour? a day?) for doing portal API tests against, if that's at all reasonable to create.

justarandomgeek
Filter Inserter
Filter Inserter
Posts: 300
Joined: Fri Mar 18, 2016 4:34 pm
Contact:

Re: Mod Portal Upload API Docs (for VSCode Extension)

Post by justarandomgeek »

For anyone else updating tools: the new login process is picky about the referer header on the submitted login form too, in addition to the form content (including csrf token of course)

The upload itself appears to work as-is.

justarandomgeek
Filter Inserter
Filter Inserter
Posts: 300
Joined: Fri Mar 18, 2016 4:34 pm
Contact:

Re: Mod Portal Upload API Docs (for VSCode Extension)

Post by justarandomgeek »

Another update seems to have added a captcha, totally thwarting my attempts to have automated uploading tools. Please can i have a real upload api?

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Mod Portal Upload API Docs (for VSCode Extension)

Post by eradicator »

+1 for upload api

I've put a link in the one-line-suggestions thread. The captcha is also really annoying for normal usage...
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

shanemadden
Fast Inserter
Fast Inserter
Posts: 128
Joined: Thu Feb 08, 2018 8:25 am
Contact:

Re: Mod Portal Upload API Docs (for VSCode Extension)

Post by shanemadden »

+1 for 'the CAPCHA killed my tool' bucket - I don't know how many others were using it as well for their mods, but at least a few. https://github.com/shanemadden/factorio ... al-publish

I know it's not a ton of work to roll the zip by hand and click around in the web ui by hand, but it really does make a big difference in terms of friction if we can let an automated process handle it instead of clicking through a web form, especially when multiplying that laborious clicking by a large number of mods.

Qon
Smart Inserter
Smart Inserter
Posts: 2091
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: Mod Portal Upload API Docs (for VSCode Extension)

Post by Qon »

My mod library is getting large enough that I'm getting hesitant about making more if I'm going to have to use the manual process to update them for new Factorio versions. Changing folder name, updating info.json version number. Updating the changelog with a "updating for new factorio version" line. Zipping. And then a manual upload process on top of that. For each and every mod. And it's especially silly to do manually for a game about automation.
I'm getting ready to automate, so I hope that it is not going to be impossible now...
shanemadden wrote:
Sun Jul 26, 2020 6:24 pm
+1 for 'the CAPCHA killed my tool' bucket - I don't know how many others were using it as well for their mods, but at least a few. https://github.com/shanemadden/factorio ... al-publish
Hey, cool stuff!

justarandomgeek
Filter Inserter
Filter Inserter
Posts: 300
Joined: Fri Mar 18, 2016 4:34 pm
Contact:

Re: Mod Portal Upload API Docs (for VSCode Extension)

Post by justarandomgeek »

minor update: the captcha now seems to not appear on at least the first attempt so if your creds are good tools work again!

shanemadden
Fast Inserter
Fast Inserter
Posts: 128
Joined: Thu Feb 08, 2018 8:25 am
Contact:

Re: Mod Portal Upload API Docs (for VSCode Extension)

Post by shanemadden »

justarandomgeek wrote:
Wed Jul 29, 2020 12:24 pm
minor update: the captcha now seems to not appear on at least the first attempt so if your creds are good tools work again!
Thanks for the tip, got the github action updated and working again.

Post Reply

Return to “Mod portal Discussion”