Skip to content

Instantly share code, notes, and snippets.

@je4npw
Created July 18, 2025 12:22
Show Gist options
  • Save je4npw/ff63d827d8bc7b515f656d39ec7a591e to your computer and use it in GitHub Desktop.
Save je4npw/ff63d827d8bc7b515f656d39ec7a591e to your computer and use it in GitHub Desktop.
Baixa as imagens de um álbum do alboompro pelo console do navegador
(async () => {
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
const downloadImage = (url, filename) => {
const a = document.createElement('a');
a.href = url;
a.download = filename || url.split('/').pop();
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
};
const getCurrentImage = () => {
const img = document.querySelector('img.object-contain');
return img ? img.src : null;
};
const clickNextButton = () => {
const nextBtn = document.querySelector('.rotate-180.right-3');
if (nextBtn) nextBtn.click();
};
const totalPhotos = 126; // atualize esse número se necessário
for (let i = 0; i < totalPhotos; i++) {
await delay(1500); // tempo para a próxima imagem carregar
const imgUrl = getCurrentImage();
if (imgUrl && imgUrl.endsWith('.JPG')) {
console.log(`Baixando imagem ${i + 1}: ${imgUrl}`);
downloadImage(imgUrl);
} else {
console.warn(`Imagem ${i + 1} não encontrada ou não é JPG.`);
}
clickNextButton();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment