BobbyWibowo / lolisafe

Blazing fast file uploader and awesome bunker written in node! 🚀
MIT License
317 stars 56 forks source link

How to access the API #439

Closed Tsubajashi closed 2 years ago

Tsubajashi commented 2 years ago

Hi! i wanted to use https://zz.ht/ as a basis of uploading content to it. I wanted to implement it in pyupload, but seem to not understand how the API responses. Is there any documentation about what kind of API Response i get, and what i would need to deliver to use it properly?

Thanks in Advance, and sorry for the inconvenience caused by this ticket.

BobbyWibowo commented 2 years ago

Hi there! Unfortunately there is no documentation for the APIs, since upstream never had any, so I never really bothered making one myself.

Either way, it should be fairly straightforward to use your browser's developer tools to sniff the network requests made to your lolisafe installation and infer the schematic from it. Otherwise you can start looking at routes/api.js for all the JSON-based APIs to see what's available, and maybe then look for the appropriate controller files from it.

BobbyWibowo commented 2 years ago

All of the API requests are essentially JSON-based (aside from upload which has to be multiform, as it has to carry the file itself as a payload), so they shouldn't appear cryptic. Elevated operations will only require your token for authentication.