forked from dbroqua/MusicTopus
{DEBUG} Get images
This commit is contained in:
parent
2f988798df
commit
fd0a9df724
3 changed files with 13 additions and 7 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue