From 4d19c41708eb009fcbf186bf43d617974e721cf4 Mon Sep 17 00:00:00 2001 From: nyne Date: Fri, 25 Oct 2024 23:03:45 +0800 Subject: [PATCH] check if the IP is banned --- ehentai.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ehentai.js b/ehentai.js index 6ad46cf..2b9215e 100644 --- a/ehentai.js +++ b/ehentai.js @@ -195,6 +195,12 @@ class Ehentai extends ComicSource { Network.setCookies('https://exhentai.org', cookies) throw `Exception: empty data\nYou may not have permission to access this page.` } + if(res.body[0] !== '<') { + if(res.body.includes("IP")) { + throw "Your IP address has been banned" + } + throw "Failed to load page" + } let document = new HtmlDocument(res.body); let galleries = [];