Page 1 of 1

Mod Portal Upload API Docs (for VSCode Extension)

Posted: Sat Jun 27, 2020 5:02 pm
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.

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

Posted: Sat Jun 27, 2020 5:46 pm
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.

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

Posted: Fri Jul 24, 2020 1:29 pm
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?

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

Posted: Fri Jul 24, 2020 3:44 pm
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...

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

Posted: Sun Jul 26, 2020 6:24 pm
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.

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

Posted: Sun Jul 26, 2020 6:58 pm
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!

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

Posted: Wed Jul 29, 2020 12:24 pm
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!

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

Posted: Sat Aug 08, 2020 2:51 pm
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.