[scraper] encode uri component for kitsu id query

This commit is contained in:
TheBeastLT
2020-12-19 14:52:12 +01:00
parent 910027358e
commit b39e54e2e0
5 changed files with 7 additions and 6 deletions

View File

@@ -124,9 +124,10 @@ async function getKitsuId(info) {
const title = escapeTitle(info.title.replace(/\s\|\s.*/, ''));
const year = info.year ? ` ${info.year}` : '';
const season = info.season > 1 ? ` S${info.season}` : '';
const query = `${title}${year}${season}`;
const key = `${title}${year}${season}`;
const query = encodeURIComponent(key);
return cacheWrapKitsuId(query,
return cacheWrapKitsuId(key,
() => needle('get', `${KITSU_URL}/catalog/series/kitsu-anime-list/search=${query}.json`, { open_timeout: 60000 })
.then((response) => {
const body = response.body;