Merge pull request #14 from Pacalini/warning

eh: handle warning
This commit is contained in:
nyne
2024-11-07 15:40:58 +08:00
committed by GitHub

View File

@@ -697,6 +697,7 @@ class Ehentai extends ComicSource {
let res = await Network.get(url, { let res = await Network.get(url, {
'cache-time': 'long', 'cache-time': 'long',
'prevent-parallel': 'true', 'prevent-parallel': 'true',
'cookie': 'nw=1'
}); });
if(res.status !== 200) { if(res.status !== 200) {
throw `Invalid status code: ${res.status}` throw `Invalid status code: ${res.status}`
@@ -932,7 +933,9 @@ class Ehentai extends ComicSource {
* @returns {Promise<{comments: Comment[], maxPage: number?}>} * @returns {Promise<{comments: Comment[], maxPage: number?}>}
*/ */
loadComments: async (comicId, subId, page, replyTo) => { 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) { if(res.status !== 200) {
throw `Invalid status code: ${res.status}` throw `Invalid status code: ${res.status}`
} }