Skip to content

Commit 1ae2977

Browse files
committed
add adult websites detection with RTA label
1 parent b8c7367 commit 1ae2977

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ module.exports = async function (originalUrl) {
5454
meta: {
5555
language: '',
5656
title: '',
57-
description: ''
57+
description: '',
58+
isRtaLabel: false
5859
},
5960
vueVersion: null,
6061
hasSSR: false, // default
@@ -121,6 +122,11 @@ module.exports = async function (originalUrl) {
121122
infos.meta.description = await page.$eval('head > meta[property="og:description"]', element => element.content).catch(() => '')
122123
}
123124

125+
const rtaLabel = await page.$eval('head > meta[name="RATING"]', element => element.content).catch(() => '')
126+
if (rtaLabel.trim() === 'RTA-5042-1996-1400-1577-RTA') {
127+
infos.meta.isRtaLabel = true
128+
}
129+
124130
// Get page language
125131
const matches = html.match(new RegExp('<html[^>]*[: ]lang="([a-z]{2}((-|_)[A-Z]{2})?)"', 'i'));
126132
if (matches && matches.length) {

0 commit comments

Comments
 (0)