mirror of
https://github.com/nadimkobeissi/mkbsd.git
synced 2025-04-20 19:46:32 -04:00
Merge 77e0e78dd4
into 82e50c64f0
This commit is contained in:
commit
194f1c5bbb
1 changed files with 3 additions and 3 deletions
6
mkbsd.js
6
mkbsd.js
|
@ -27,12 +27,12 @@ async function main() {
|
|||
let fileIndex = 1;
|
||||
for (const key in data) {
|
||||
const subproperty = data[key];
|
||||
if (subproperty && subproperty.dhd) {
|
||||
const imageUrl = subproperty.dhd;
|
||||
for(const subpropertyKey in subproperty) {
|
||||
const imageUrl = subproperty[subpropertyKey];
|
||||
console.info(`🔍 Found image URL!`);
|
||||
await delay(100);
|
||||
const ext = path.extname(new URL(imageUrl).pathname) || '.jpg';
|
||||
const filename = `${fileIndex}${ext}`;
|
||||
const filename = `${key}-${subpropertyKey}${ext}`;
|
||||
const filePath = path.join(downloadDir, filename);
|
||||
await downloadImage(imageUrl, filePath);
|
||||
console.info(`🖼️ Saved image to ${filePath}`);
|
||||
|
|
Loading…
Add table
Reference in a new issue