feat: PDF via 12ft.io, weitere Browser-Links (archive.ph, removepaywall)

This commit is contained in:
2026-06-12 14:10:20 +02:00
parent bf5e458e28
commit 762783b8ab
2 changed files with 34 additions and 12 deletions

View File

@@ -55,11 +55,12 @@ router.get('/cdx', authenticate, async (req, res) => {
});
// ── POST /api/tools/paywallkiller/pdf ─────────────────────────────────────
// Immer Wayback-URL verwenden Originalseite hat server-seitige Paywall
// Lädt via 12ft.io (Paywall-Bypasser, kein CAPTCHA) → PDF
router.post('/pdf', authenticate, async (req, res) => {
const { originalUrl, archiveUrl } = req.body;
// archiveUrl (Wayback) bevorzugen hat vollen Text ohne server-seitige Paywall
const targetUrl = archiveUrl || originalUrl;
if (!originalUrl && !archiveUrl) return res.status(400).json({ error: 'URL fehlt' });
// 12ft.io umgeht Paywalls indem es die Googlebot-Version abruft
const targetUrl = `https://12ft.io/proxy?q=${encodeURIComponent(originalUrl || archiveUrl)}`;
if (!targetUrl || typeof targetUrl !== 'string') return res.status(400).json({ error: 'URL fehlt' });
const tmpFile = path.join('/tmp', `pwk_${crypto.randomBytes(8).toString('hex')}.pdf`);