mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-24 04:59:06 +01:00
16 lines
358 B
TypeScript
16 lines
358 B
TypeScript
|
import { createTemp } from './create-temp';
|
||
|
import { downloadUrl } from './donwload-url';
|
||
|
import { detectMine } from './detect-mine';
|
||
|
|
||
|
export async function detectUrlMine(url: string) {
|
||
|
const [path, cleanup] = await createTemp();
|
||
|
|
||
|
try {
|
||
|
await downloadUrl(url, path);
|
||
|
const [type] = await detectMine(path);
|
||
|
return type;
|
||
|
} finally {
|
||
|
cleanup();
|
||
|
}
|
||
|
}
|