[Resolv]How to download mods without login on Mod portal API

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
yuta0801
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Apr 04, 2018 12:07 am
Contact:

[Resolv]How to download mods without login on Mod portal API

Post by yuta0801 »

I want to make mods downloading tool.
Wiki says the Mod Portal API can download all mods available on the official Factorio mod portal without any kind of authentication or account information, but I cant found how to download mods without login

https://wiki.factorio.com/Mod_portal_API
Last edited by yuta0801 on Wed May 23, 2018 5:42 am, edited 1 time in total.

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: How to download mods without login on Mod portal API

Post by steinio »

yuta0801 wrote:I want to make mods downloading tool.
Wiki says the Mod Portal API can download all mods available on the official Factorio mod portal without any kind of authentication or account information, but I cant found how to download mods without login

https://wiki.factorio.com/Mod_portal_API
Wow that would be so great for software pirates, wouldn't be it?
Image

Transport Belt Repair Man

View unread Posts

Koub
Global Moderator
Global Moderator
Posts: 7203
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: How to download mods without login on Mod portal API

Post by Koub »

I think you can use the API without authentication, but you'll probably need to be authenticated to actually DL a mod.
Koub - Please consider English is not my native language.

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

Re: How to download mods without login on Mod portal API

Post by eradicator »

Simply ask the user for their service token. It's stored in player-data.json.

yuta0801
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Apr 04, 2018 12:07 am
Contact:

Re: How to download mods without login on Mod portal API

Post by yuta0801 »

eradicator wrote:Simply ask the user for their service token. It's stored in player-data.json.
Can I download mod with token?

yuta0801
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Apr 04, 2018 12:07 am
Contact:

Re: How to download mods without login on Mod portal API

Post by yuta0801 »

I can seve user's password or, every time download mods, ask password.
but, I don't think it is best practice.

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

Re: How to download mods without login on Mod portal API

Post by eradicator »

yuta0801 wrote:
eradicator wrote:Simply ask the user for their service token. It's stored in player-data.json.
Can I download mod with token?
Sure. That's how the game does it. Just look at the console while using the in-game mod browser or something.
yuta0801 wrote:I can seve user's password or, every time download mods, ask password.
but, I don't think it is best practice.
Ask them for the path to player-data.json. It's already stored on disk :P

yuta0801
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Apr 04, 2018 12:07 am
Contact:

Re: How to download mods without login on Mod portal API

Post by yuta0801 »

eradicator wrote:
yuta0801 wrote:
eradicator wrote:Simply ask the user for their service token. It's stored in player-data.json.
Can I download mod with token?
Sure. That's how the game does it. Just look at the console while using the in-game mod browser or something.
yuta0801 wrote:I can seve user's password or, every time download mods, ask password.
but, I don't think it is best practice.
Ask them for the path to player-data.json. It's already stored on disk :P
The program to get the token is completed, but I do not know how to download MOD with token...
Can you tell me the way of it in more detail? thank you.

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

Re: How to download mods without login on Mod portal API

Post by eradicator »

/download/modname-goes-here/5aa906e9211f35000ae7c569?username=eradicator&token=<private>

yuta0801
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Apr 04, 2018 12:07 am
Contact:

Re: How to download mods without login on Mod portal API

Post by yuta0801 »

eradicator wrote:/download/modname-goes-here/5aa906e9211f35000ae7c569?username=eradicator&token=<private>
Thank you!

yuta0801
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Apr 04, 2018 12:07 am
Contact:

Re: How to download mods without login on Mod portal API

Post by yuta0801 »

I was able to make a beautiful tool for your help. Thank you!

viewtopic.php?f=69&t=60027

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

Re: How to download mods without login on Mod portal API

Post by eradicator »

Nice it worked out :). Btw quick look at your code i see it asks for 'Please enter your password', but the service token is not the password. So maybe you should change it to 'Please enter your service token'?

yuta0801
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Apr 04, 2018 12:07 am
Contact:

Re: How to download mods without login on Mod portal API

Post by yuta0801 »

The app first looks for tokens from the player-data.json and, if not found, ask the username and password to retrieve the token from the API because I think the general user is not familiar with token.

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

Re: How to download mods without login on Mod portal API

Post by eradicator »

yuta0801 wrote:The app first looks for tokens from the player-data.json and, if not found, ask the username and password to retrieve the token from the API because I think the general user is not familiar with token.
Ah. I wasn't sure if the API supplied a way of retrieving the token :). And i really only took a very short look at the code :p.

Post Reply

Return to “Technical Help”