From 5005b43671f9d80a4359b97bc0aca2e7fd7f4b46 Mon Sep 17 00:00:00 2001 From: Adam Kemish <49228220+Soopyboo32@users.noreply.github.com> Date: Fri, 31 Jan 2025 01:15:50 +0800 Subject: [PATCH] Fix some bugs with inkitt (#1478) * Fix some bugs with inkitt * remove debug --- src/plugins/english/inkitt.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/english/inkitt.ts b/src/plugins/english/inkitt.ts index 113164c..10d0265 100644 --- a/src/plugins/english/inkitt.ts +++ b/src/plugins/english/inkitt.ts @@ -9,7 +9,7 @@ class InkittPlugin implements Plugin.PluginBase { name = 'Inkitt'; icon = 'src/en/inkitt/icon.png'; site = 'https://www.inkitt.com'; - version = '1.0.0'; + version = '1.0.1'; imageRequestInit?: Plugin.ImageRequestInit | undefined = undefined; //flag indicates whether access to LocalStorage, SesesionStorage is required. @@ -53,7 +53,7 @@ class InkittPlugin implements Plugin.PluginBase { } getPath(novel: any) { - return novel.category_one + '/' + novel.id; + return (novel.category_one || novel.genres[0]) + '/' + novel.id; } async parseNovel(novelPath: string): Promise { @@ -66,13 +66,15 @@ class InkittPlugin implements Plugin.PluginBase { name: loadedCheerio('h1.story-title').text(), }; - novel.author = loadedCheerio('a.author-link').text(); + novel.author = loadedCheerio('dl > dd > a.author-link').text(); novel.genres = loadedCheerio('dd.genres > a') .map((i, el) => loadedCheerio(el).text()) .toArray() .join(', '); - const status = loadedCheerio('div.dlc > dl > dd').text().trim(); + const status = loadedCheerio('div.dlc > dl:has(dt:contains("Status")) > dd') + .text() + .trim(); if (status === 'Complete') novel.status = NovelStatus.Completed; if (status === 'Ongoing') novel.status = NovelStatus.Ongoing;