[scraper] use html escape lib

This commit is contained in:
TheBeastLT
2020-03-23 16:09:28 +01:00
parent cd9530bfa7
commit fd3fd9c2fe
3 changed files with 8 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
const needle = require('needle');
const nameToImdb = require('name-to-imdb');
const bing = require('nodejs-bing');
const he = require('he');
const { cacheWrapImdbId, cacheWrapKitsuId, cacheWrapMetadata } = require('./cache');
const { Type } = require('./types');
@@ -86,11 +87,7 @@ function escapeTitle(title) {
}
function escapeHTML(title) {
return title
.replace(/'|'/g, '\'')
.replace(/&|&/g, '&')
.replace(/!/g, '!')
.replace(/%/g, '%');
return he.decode(title);
}
async function getImdbId(info, type) {