Scrape Facebook Downloader, base url : https://www.a2zconverter.com/facebook-video-downloader" target="_blank" rel="noopener noreferrer">https://www.a2zconverter.com/facebook-video-downloader
const axios = require('axios');
const FBDL = async (facebookUrl) => {
if (!facebookUrl) {
throw new Error("URL Facebook tidak boleh kosong");
}
const apiUrl = `https://www.a2zconverter.com/api/files/proxy?url=${encodeURIComponent(facebookUrl)}`;
const headers = {
'Referer': 'https://www.a2zconverter.com/facebook-video-downloader',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36'
};
try {
const response = await axios.get(apiUrl, {
headers: headers
});
return response.data;
} catch (error) {
console.error(`Gagal mengambil data: ${error.message}`);
return null;
}
};
module.exports = FBDL;