1 Commits

Author SHA1 Message Date
Indrawan I.
67be3acc6e fix: proper error handler (#23)
* re use legacy errors

* 8.3.6-alpha
2026-05-14 09:56:52 +07:00
3 changed files with 71 additions and 82 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "lustpress", "name": "lustpress",
"version": "8.3.5-alpha", "version": "8.3.6-alpha",
"description": "RESTful and experimental API for PH and other R18 websites", "description": "RESTful and experimental API for PH and other R18 websites",
"main": "src/index.ts", "main": "src/index.ts",
"scripts": { "scripts": {

View File

@@ -88,18 +88,7 @@ class LustPress {
const domain = new URL(url).hostname; const domain = new URL(url).hostname;
const headers: Record<string, string> = { const headers: Record<string, string> = {
"User-Agent": isPornhub ? this.browserUA : this.useragent, "User-Agent": isPornhub ? this.browserUA : this.useragent
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Accept-Language": "en-US,en;q=0.9",
"Accept-Encoding": "gzip, deflate, br",
"Sec-Ch-Ua": '"Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"',
"Sec-Ch-Ua-Mobile": "?0",
"Sec-Ch-Ua-Platform": '"Windows"',
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "none",
"Sec-Fetch-User": "?1",
"Upgrade-Insecure-Requests": "1"
}; };
if (isPornhub) { if (isPornhub) {

View File

@@ -59,7 +59,7 @@ const app = new Elysia()
stack: (error as Error).stack, stack: (error as Error).stack,
}; };
}) })
.use(scrapeRoutes) .use(scrapeRoutes) // reuse legacy error handling
.listen(process.env.PORT || 3000); .listen(process.env.PORT || 3000);
console.log( console.log(