removed scrapper

This commit is contained in:
2025-12-06 19:19:33 +01:00
parent 94cceedf03
commit b2f8d69832
32 changed files with 604 additions and 25253 deletions

View File

@@ -1,7 +1,5 @@
const fastify = require('fastify')({ logger: true });
const path = require('path');
const { spawn } = require('child_process');
const fs = require('fs');
const jwt = require("jsonwebtoken");
const { initHeadless } = require("./dist/shared/headless");
const { initDatabase } = require('./dist/shared/database');
@@ -63,40 +61,6 @@ fastify.register(userRoutes, { prefix: '/api' });
fastify.register(anilistRoute, { prefix: '/api' });
fastify.register(listRoutes, { prefix: '/api' });
function startCppScraper() {
const exePath = path.join(
__dirname,
'src',
'metadata',
process.platform === 'win32' ? 'anilist.exe' : 'anilist'
);
const dllPath = path.join(__dirname, 'src', 'metadata', 'binaries');
if (!fs.existsSync(exePath)) {
console.error(`❌ C++ Error: Could not find executable at: ${exePath}`);
console.error(" Did you compile it? (g++ src/metadata/anilist.cpp -o src/metadata/anilist.exe ...)");
return;
}
const env = { ...process.env };
env.PATH = `${dllPath};${env.PATH}`;
console.log("⚡ Starting WaifuBoard Scraper Engine (C++)...");
const scraper = spawn(exePath, [], {
stdio: 'inherit',
cwd: __dirname,
env: env
});
scraper.on('error', (err) => {
console.error('❌ Failed to spawn C++ process:', err);
});
scraper.on('close', (code) => {
console.log(`✅ Scraper process finished with code ${code}`);
});
}
const start = async () => {
try {
@@ -111,8 +75,6 @@ const start = async () => {
await fastify.listen({ port: 54322, host: '0.0.0.0' });
console.log(`Server running at http://localhost:54322`);
startCppScraper();
await initHeadless();
} catch (err) {