Atualização automática: 2026-05-23 22:02:28

This commit is contained in:
Hermes
2026-05-23 22:02:28 +00:00
parent 7cfc1724d3
commit bfa0ab4394
6 changed files with 152 additions and 14 deletions
+5 -4
View File
@@ -65,7 +65,7 @@ class WgetCloner {
}
}
async cloneWebsite(url) {
async cloneWebsite(url, customFolderName = null) {
console.log(`\n${'='.repeat(60)}`);
console.log(`🚀 CLONAGEM PROFISSIONAL COM WGET`);
console.log(`${'='.repeat(60)}`);
@@ -98,7 +98,8 @@ class WgetCloner {
const urlObj = new URL(url);
const siteName = this.sanitizeFilename(urlObj.hostname);
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
const siteDir = path.join(this.baseOutputDir, `${siteName}_${timestamp}`);
const finalFolderName = customFolderName ? this.sanitizeFilename(customFolderName) : `${siteName}_${timestamp}`;
const siteDir = path.join(this.baseOutputDir, finalFolderName);
this.ensureDirectoryExists(siteDir);
console.log(`📁 Salvando em: ${siteDir}\n`);
@@ -328,13 +329,13 @@ class WgetCloner {
// API
app.post('/wget-clone', async (req, res) => {
try {
const { url } = req.body;
const { url, folderName } = req.body;
if (!url) {
return res.status(400).json({ error: 'URL obrigatória' });
}
const cloner = new WgetCloner();
const result = await cloner.cloneWebsite(url);
const result = await cloner.cloneWebsite(url, folderName);
res.json({ success: true, data: result });
} catch (error) {