From bf26654d17b4b4325b7568d791bd19e159a9b46a Mon Sep 17 00:00:00 2001 From: Pacalini <141402887+Pacalini@users.noreply.github.com> Date: Thu, 7 Nov 2024 15:14:21 +0800 Subject: [PATCH] eh: handle warning --- ehentai.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ehentai.js b/ehentai.js index 9115fe3..e6c2fe8 100644 --- a/ehentai.js +++ b/ehentai.js @@ -697,6 +697,7 @@ class Ehentai extends ComicSource { let res = await Network.get(url, { 'cache-time': 'long', 'prevent-parallel': 'true', + 'cookie': 'nw=1' }); if(res.status !== 200) { throw `Invalid status code: ${res.status}` @@ -932,7 +933,9 @@ class Ehentai extends ComicSource { * @returns {Promise<{comments: Comment[], maxPage: number?}>} */ loadComments: async (comicId, subId, page, replyTo) => { - let res = await Network.get(`${comicId}?hc=1`, {}); + let res = await Network.get(`${comicId}?hc=1`, { + 'cookie': 'nw=1' + }); if(res.status !== 200) { throw `Invalid status code: ${res.status}` }