@@ -5,7 +5,7 @@ const { createHash } = require('crypto')
5
5
const { URL } = require ( 'url' )
6
6
const { join } = require ( 'path' )
7
7
const { tmpdir } = require ( 'os' )
8
- const { isCrawlable, puppeteerArgs, puppeteerViewport } = require ( './utils' )
8
+ const { isCrawlable, puppeteerArgs, puppeteerViewport, isAdultContentDomain } = require ( './utils' )
9
9
const { hasVue, getVueMeta, getFramework, getPlugins, getUI, getNuxtMeta, getNuxtModules } = require ( './detectors' )
10
10
const consola = require ( 'consola' )
11
11
@@ -141,11 +141,15 @@ async function analyze (originalUrl, options = {}) {
141
141
}
142
142
infos . meta . siteName = await page . $eval ( 'head > meta[property="og:site_name"]' , element => element . content ) . catch ( ( ) => '' )
143
143
144
- const rtaLabel = await page . $eval ( 'head > meta[name="RATING"]' , element => element . content ) . catch ( ( ) => '' )
145
- if ( rtaLabel . trim ( ) === 'RTA-5042-1996-1400-1577-RTA' ) {
144
+ // Is adult website?
145
+ const rtaLabel = await page . $eval ( 'head > meta[name="rating"]' , element => element . content ) . catch ( ( ) => '' )
146
+ if ( [ 'adult' , 'RTA-5042-1996-1400-1577-RTA' ] . includes ( rtaLabel . trim ( ) ) ) {
146
147
infos . meta . isAdultContent = true
148
+ } else {
149
+ infos . meta . isAdultContent = await isAdultContentDomain ( domain )
147
150
}
148
151
152
+
149
153
// Get page language
150
154
const matches = html . match ( new RegExp ( '<html[^>]*[: ]lang="([a-z]{2}((-|_)[A-Z]{2})?)"' , 'i' ) ) ;
151
155
if ( matches && matches . length ) {
0 commit comments