Atualização automática: 2026-05-18 11:00:54
This commit is contained in:
@@ -72,10 +72,10 @@ class WgetCloner {
|
||||
console.log(`🌐 URL: ${url}\n`);
|
||||
|
||||
// Sempre usar o wget.exe local primeiro
|
||||
let wgetCommand = this.wgetPath;
|
||||
let wgetCommand = '/bin/wget'; // Linux system wget
|
||||
|
||||
// Verificar se o wget.exe local existe
|
||||
if (!fs.existsSync(this.wgetPath)) {
|
||||
if (false) { // bypass wget.exe check
|
||||
console.log('⚠️ wget.exe local não encontrado');
|
||||
|
||||
// Tentar baixar
|
||||
@@ -168,13 +168,19 @@ class WgetCloner {
|
||||
console.log(`${'='.repeat(60)}\n`);
|
||||
});
|
||||
|
||||
// countFiles inline helper
|
||||
var countFiles = function(dir) { var ts=0,fc=0; (function rec(d){if(!fs.existsSync(d))return;fs.readdirSync(d).forEach(function(i){var p=path.join(d,i),s=fs.statSync(p);if(s.isDirectory()&&i.indexOf("cloned-sites")==-1&&i.indexOf(".versions")==-1)rec(p);else if(!s.isDirectory()){ts+=s.size;fc++;}});})(dir);return{fileCount:fc,totalSize:ts};};
|
||||
|
||||
// Criar arquivo de informações
|
||||
const stats = countFiles(siteDir);
|
||||
const info = {
|
||||
originalUrl: url,
|
||||
clonedAt: new Date().toISOString(),
|
||||
directory: siteDir,
|
||||
method: 'wget',
|
||||
success: true
|
||||
success: true,
|
||||
fileCount: stats.fileCount,
|
||||
totalSize: stats.totalSize
|
||||
};
|
||||
|
||||
fs.writeFileSync(
|
||||
|
||||
Reference in New Issue
Block a user