A decentralized music tracking and discovery platform built on AT Protocol 🎵 forked from rocksky.app/rocksky
Something went wrong. Try again.
1234567891011121314151617181920import axios from "axios";
export async function getContentType(url: string): Promise<string | null> { const response = await axios.head(url); return response.headers["content-type"] || null;}
export default async function downloadImage( url?: string | null,): Promise<Buffer | null> { if (!url) { return null; }
const response = await axios.get(url, { responseType: "arraybuffer", }); return Buffer.from(response.data);}