const axios = require('axios');
async function aiorapidapi(url) {
try {
if (!url.startsWith('https://')) throw new Error('Invalid URL.');
const { data } = await axios.post('https://auto-download-all-in-one.p.rapidapi.com/v1/social/autolink', {
url: url
}, {
headers: {
'content-type': 'application/json; charset=utf-8',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36 OPR/78.0.4093.184',
'x-rapidapi-host': 'auto-download-all-in-one.p.rapidapi.com',
'x-rapidapi-key': 'ca5c6d6fa3mshfcd2b0a0feac6b7p140e57jsn72684628152a'
}
});
return data;
} catch (error) {
throw new Error(error.message);
}
}
aiorapidapi('https://x.com/coolpan967/status/2016539130352832648').then(console.log);