Compare commits
2 commits
0d280b26fd
...
2145b26f7c
Author | SHA1 | Date | |
---|---|---|---|
2145b26f7c | |||
4710cbccbd |
3 changed files with 618 additions and 322 deletions
912
package-lock.json
generated
912
package-lock.json
generated
File diff suppressed because it is too large
Load diff
14
package.json
14
package.json
|
@ -1,20 +1,20 @@
|
|||
{
|
||||
"name": "@fogtype/gadl",
|
||||
"version": "1.6.0",
|
||||
"version": "1.7.0",
|
||||
"license": "AGPL-3.0",
|
||||
"type": "module",
|
||||
"bin": "bin/run.js",
|
||||
"dependencies": {
|
||||
"fflate": "^0.8.1",
|
||||
"playwright": "1.40.1",
|
||||
"fflate": "^0.8.2",
|
||||
"playwright": "1.48.1",
|
||||
"sqlite": "^5.1.1",
|
||||
"sqlite3": "^5.1.6",
|
||||
"tsx": "^4.7.0"
|
||||
"sqlite3": "^5.1.7",
|
||||
"tsx": "^4.19.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.10.5"
|
||||
"@types/node": "^22.8.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.10.0"
|
||||
"node": ">=22.8.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,16 +23,14 @@ function Reader(page: PageOrFrame, readerUrl: string) {
|
|||
await page.goto(readerUrl);
|
||||
},
|
||||
async downloadUrl(): Promise<null | string> {
|
||||
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;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue