[Resolv]How to download mods without login on Mod portal API
[Resolv]How to download mods without login on Mod portal API
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
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.
Re: How to download mods without login on Mod portal API
Wow that would be so great for software pirates, wouldn't be it?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
Re: How to download mods without login on Mod portal API
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.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: How to download mods without login on Mod portal API
Simply ask the user for their service token. It's stored in player-data.json.
Re: How to download mods without login on Mod portal API
Can I download mod with token?eradicator wrote:Simply ask the user for their service token. It's stored in player-data.json.
Re: How to download mods without login on Mod portal API
I can seve user's password or, every time download mods, ask password.
but, I don't think it is best practice.
but, I don't think it is best practice.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: How to download mods without login on Mod portal API
Sure. That's how the game does it. Just look at the console while using the in-game mod browser or something.yuta0801 wrote:Can I download mod with token?eradicator wrote:Simply ask the user for their service token. It's stored in player-data.json.
Ask them for the path to player-data.json. It's already stored on disk :Pyuta0801 wrote:I can seve user's password or, every time download mods, ask password.
but, I don't think it is best practice.
Re: How to download mods without login on Mod portal API
The program to get the token is completed, but I do not know how to download MOD with token...eradicator wrote:Sure. That's how the game does it. Just look at the console while using the in-game mod browser or something.yuta0801 wrote:Can I download mod with token?eradicator wrote:Simply ask the user for their service token. It's stored in player-data.json.
Ask them for the path to player-data.json. It's already stored on diskyuta0801 wrote:I can seve user's password or, every time download mods, ask password.
but, I don't think it is best practice.
Can you tell me the way of it in more detail? thank you.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: How to download mods without login on Mod portal API
/download/modname-goes-here/5aa906e9211f35000ae7c569?username=eradicator&token=<private>
Re: How to download mods without login on Mod portal API
Thank you!eradicator wrote:/download/modname-goes-here/5aa906e9211f35000ae7c569?username=eradicator&token=<private>
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: How to download mods without login on Mod portal API
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'?
Re: How to download mods without login on Mod portal API
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.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: How to download mods without login on Mod portal API
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.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.