From eddb19782729cf250c05492a0a70e11007b7dab0 Mon Sep 17 00:00:00 2001 From: tachibana-akiko <156988365+tachibana-akiko@users.noreply.github.com> Date: Sat, 27 Jan 2024 17:53:17 +0700 Subject: [PATCH] fix: can't get chap (#62) * fix: can't get chap * chore: release v0.1.19 * chore: release v0.1.20 --- package.json | 2 +- src/parsers/truyen-tranh/[slug].ts | 2 +- src/parsers/truyen-tranh/[slug]/[ep-id].ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 5cf506f..4e14c55 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nettruyen", "pluginName": "Net Truyen", - "version": "0.1.18", + "version": "0.1.20", "description": "Plugin nguồn Net Truyen", "author": "Tachibana Shin ", "homepage": "https://github.com/manga-raiku/raiku-plugin-nettruyen", diff --git a/src/parsers/truyen-tranh/[slug].ts b/src/parsers/truyen-tranh/[slug].ts index 3ba1cc4..d032476 100644 --- a/src/parsers/truyen-tranh/[slug].ts +++ b/src/parsers/truyen-tranh/[slug].ts @@ -19,7 +19,7 @@ export default function slug(html: string, now: number): Comic { const $detail = $("#item-detail") const name = $detail.find("h1").text().trim() - const uid = parseInt(html.match(/gOpts\.comicId=(\d+)/)?.[1] ?? "") + const uid = parseInt(html.match(/gOpts\.comicId=\s*'?(\d+)'?\s*/)?.[1] ?? "") // // eslint-disable-next-line @typescript-eslint/no-non-null-assertion // const key = html.match(/gOpts\.key=('|")([^"']+)\1/)![2]! // eslint-disable-next-line camelcase diff --git a/src/parsers/truyen-tranh/[slug]/[ep-id].ts b/src/parsers/truyen-tranh/[slug]/[ep-id].ts index 3e7eeff..ef5d86f 100644 --- a/src/parsers/truyen-tranh/[slug]/[ep-id].ts +++ b/src/parsers/truyen-tranh/[slug]/[ep-id].ts @@ -24,8 +24,8 @@ export default function epId(html: string, now: number): ComicChapter { } } as const - const manga_id = parseInt(html.match(/gOpts\.comicId=(\d+)/)?.[1] ?? "") + "" - const ep_id = parseInt(html.match(/gOpts\.chapterId=(\d+)/)?.[1] ?? "") + "" + const manga_id = parseInt(html.match(/gOpts\.comicId=\s+'?(\d+)'?\s*/)?.[1] ?? "") + "" + const ep_id = parseInt(html.match(/gOpts\.chapterId=\s*'?(\d+)'?\s*/)?.[1] ?? "") + "" const cdn = html.match(/gOpts\.cdn="([^"]+)"/)?.[1] const cdn2 = html.match(/gOpts\.cdn2="([^"]+)"/)?.[1] // // eslint-disable-next-line @typescript-eslint/no-non-null-assertion