diff --git a/lib/Constants.js b/lib/Constants.js index be632d83..ecabe1fc 100644 --- a/lib/Constants.js +++ b/lib/Constants.js @@ -14,12 +14,19 @@ const SITE_LIST = { 3: { name: 'The Doujinshi & Manga Lexicon', backupURL: data => `http://doujinshi.mugimugi.org/index.php?P=BOOK&ID=${data.data.ddb_id}`, - URLRegex: /(?:http:\/\/)?doujinshi\.mugimugi\.org\/index\.php?P=BOOK&ID=\d+/i + URLRegex: /(?:http:\/\/)?doujinshi\.mugimugi\.org\/index\.php?P=BOOK&ID=\d+/i, + getRating: data => data.match(/
(.*?)<\/p>/i); + + if (!match) return 1; + else return match[1].toLowerCase().includes('r-18') ? 3 : 1; + } }, 8: { name: 'Nico Nico Seiga', @@ -68,7 +75,8 @@ const SITE_LIST = { 19: { name: '2D-Market', backupURL: data => `http://2d-market.com/Comic/${data.header.thumbnail.match(/2d_market\/(\d+)/i)[1]}-${data.data.source.replace(' ', '-')}`, - URLRegex: /(?:https?:\/\/)2d-market\.com\/Comic\/\d+/i + URLRegex: /(?:https?:\/\/)2d-market\.com\/Comic\/\d+/i, + getRating: () => RATINGS.NSFW }, 20: { name: 'MediBang', @@ -94,7 +102,8 @@ const SITE_LIST = { 26: { name: 'Konachan', backupURL: data => `https://konachan.com/post/show/${data.data.konachan_id}`, - URLRegex: /(?:http:\/\/)?konachan\.com\/post\/show\/\d{6}/i + URLRegex: /(?:http:\/\/)?konachan\.com\/post\/show\/\d+/i, + getRating: body => [null, 'Safe', 'Questionable', 'Explicit'].indexOf(body.match(/