{DEBUG} Get images

This commit is contained in:
Damien Broqua 2023-09-18 14:31:51 +02:00
parent 2f988798df
commit fd0a9df724
3 changed files with 13 additions and 7 deletions

View file

@ -62,11 +62,15 @@ export const uploadFromUrl = async (url) => {
const filename = `${uuid()}.jpg`;
const file = `/tmp/${filename}`;
const { data } = await axios.get(url, { responseType: "arraybuffer" });
const { data } = await axios.get(url, {
headers: {
"User-Agent":
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/117.0",
},
responseType: "arraybuffer",
});
fs.writeFileSync(file, data);
return uploadFromFile(filename, file, true);
// return s3Object;
};