From c7a29dc0667e4699701616b0b94d522818258e7b Mon Sep 17 00:00:00 2001 From: nyne Date: Thu, 7 Nov 2024 09:50:57 +0800 Subject: [PATCH] check data --- ehentai.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ehentai.js b/ehentai.js index 9001253..9115fe3 100644 --- a/ehentai.js +++ b/ehentai.js @@ -597,6 +597,9 @@ class Ehentai extends ComicSource { if (res.status !== 200) { throw `Invalid status code: ${res.status}` } + if(res.body.trim().length === 0) { + throw `Exception: empty data\nYou may not have permission to access this page.` + } let document = new HtmlDocument(res.body); let tags = new Map();