added auto-archive script + minor improvements

This commit is contained in:
daniel31x13
2023-12-10 15:26:44 -05:00
parent 8e49ccf723
commit 375a55dd37
11 changed files with 373 additions and 29 deletions
+6 -2
View File
@@ -23,7 +23,7 @@ export default async function urlHandler(
},
});
// Archive.org
// archive.org
if (user?.archiveAsWaybackMachine) sendToWayback(url);
@@ -82,9 +82,13 @@ export default async function urlHandler(
// Screenshot/PDF
let faulty = false;
await page
.evaluate(autoScroll, Number(process.env.AUTOSCROLL_TIMEOUT) || 30)
.catch((e) => (faulty = true));
.catch((err) => {
console.log(err);
faulty = true;
});
const linkExists = await prisma.link.findUnique({
where: { id: linkId },