mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-29 07:46:43 -06:00
7bebea087c
* Refactor download * emoji type
15 lines
358 B
TypeScript
15 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();
|
|
}
|
|
}
|