feat: mark unsafe for R-18 posts on Pixiv
Co-authored-by: Keo Cheung <keocheung@outlook.com>master
parent
51be6dfdcd
commit
eda941d889
|
|
@ -45,8 +45,10 @@
|
|||
"typescript": "^4.9.5"
|
||||
},
|
||||
"exports": {
|
||||
".": "./dist/index.js",
|
||||
"./": "./dist/"
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"jest": {
|
||||
"preset": "./jest.preset.cjs",
|
||||
|
|
|
|||
|
|
@ -70,6 +70,9 @@ export default class Pixiv extends ScrapeEngineBase {
|
|||
post.contentType = guessContentType(post.contentUrl);
|
||||
post.referrer = document.location.origin;
|
||||
result.tryAddPost(post);
|
||||
if (document.querySelector('a[href*="/tags/R-18/artworks"]')) {
|
||||
post.rating = "unsafe";
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -5,12 +5,13 @@
|
|||
"DOM",
|
||||
"DOM.Iterable"
|
||||
],
|
||||
"rootDir": "./src/",
|
||||
"outDir": "./dist/",
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"module": "ES2020",
|
||||
"moduleResolution": "NodeNext",
|
||||
"target": "ES2020",
|
||||
"module": "node16",
|
||||
"moduleResolution": "node16",
|
||||
"target": "es2020",
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"removeComments": true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue