const axios = require("axios"); async function urlToBuffer(url) { try { const response = await axios.get(url, { responseType: "arraybuffer", }); return Buffer.from(response.data, "binary"); } catch (error) { console.error("Terjadi kesalahan:", error); throw error; } } async function upload(url) { try { let buff = await urlToBuffer(url); let hasil = await Upload(buff); return hasil; } catch (e) { return e; } } module.exports = { urlToBuffer };