feat: PDF via 12ft.io, weitere Browser-Links (archive.ph, removepaywall)
This commit is contained in:
@@ -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`);
|
||||
|
||||
Reference in New Issue
Block a user