diff --git a/package-lock.json b/package-lock.json index bd78de8..0f87222 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@fogtype/gadl", - "version": "1.6.0", + "version": "1.6.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@fogtype/gadl", - "version": "1.6.0", + "version": "1.6.1", "license": "AGPL-3.0", "dependencies": { "fflate": "^0.8.1", diff --git a/package.json b/package.json index 6aae56f..dcac3b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fogtype/gadl", - "version": "1.6.0", + "version": "1.6.1", "license": "AGPL-3.0", "type": "module", "bin": "bin/run.js", diff --git a/platforms/dlsite-maniax.ts b/platforms/dlsite-maniax.ts index 83b2c87..7cc8529 100644 --- a/platforms/dlsite-maniax.ts +++ b/platforms/dlsite-maniax.ts @@ -23,16 +23,14 @@ function Reader(page: PageOrFrame, readerUrl: string) { await page.goto(readerUrl); }, async downloadUrl(): Promise { - const isBook = workId.startsWith("B"); + const url = `https://www.dlsite.com/home/download/=/product_id/${workId}.html`; - if (isBook) { - // PDFファイルでないことを確認 - const items = await page.waitForSelector(workTreeItemsSelector); - const text = await items.textContent(); - if (!text?.match(/PDFファイル/u)) return null; - } + if (!workId.startsWith("B")) return url; - return `https://www.dlsite.com/home/download/=/product_id/${workId}.html`; + const items = await page.waitForSelector(workTreeItemsSelector); + const text = await items.textContent(); + + return text?.match(/画像/) ? null : url; }, }; }