mirror of
https://git.coom.tech/fuckjannies/lolipiss.git
synced 2024-06-27 05:02:35 +00:00
47 lines
1.0 KiB
TypeScript
47 lines
1.0 KiB
TypeScript
![]() |
import { GM_fetch } from "./requests";
|
||
|
|
||
|
const lolisafe = (domain: string) => ({
|
||
|
domain,
|
||
|
async uploadFile(f: Blob) {
|
||
|
return '';
|
||
|
}
|
||
|
});
|
||
|
|
||
|
function parseForm(data: object) {
|
||
|
const form = new FormData();
|
||
|
|
||
|
Object.entries(data)
|
||
|
.filter(([key, value]) => value !== null)
|
||
|
.map(([key, value]) => form.append(key, value));
|
||
|
|
||
|
return form;
|
||
|
}
|
||
|
|
||
|
const catbox = (domain: string) => ({
|
||
|
domain,
|
||
|
async uploadFile(inj: Blob) {
|
||
|
const resp = await GM_fetch(`https://${domain}/user/api.php`, {
|
||
|
method: 'POST',
|
||
|
body: parseForm({
|
||
|
reqtype: 'fileupload',
|
||
|
fileToUpload: inj
|
||
|
})
|
||
|
});
|
||
|
return resp.text();
|
||
|
}
|
||
|
});
|
||
|
|
||
|
export type API = {
|
||
|
domain: string;
|
||
|
uploadFile(f: Blob): Promise<string>;
|
||
|
}
|
||
|
|
||
|
export const filehosts: API[] = [
|
||
|
catbox('catbox.moe'),
|
||
|
lolisafe('zz.ht'),
|
||
|
lolisafe('imouto.kawaii.su'),
|
||
|
lolisafe('take-me-to.space'),
|
||
|
lolisafe('loli.solutions'),
|
||
|
lolisafe('loli.graphics'),
|
||
|
lolisafe('sucks-to-b.eu')
|
||
|
];
|