adds kitsu mapping for horrible subs

This commit is contained in:
TheBeastLT
2019-12-30 18:35:02 +01:00
parent a73cdb6b54
commit 7aa0572fb8
3 changed files with 3612 additions and 8832 deletions

View File

@@ -88,8 +88,9 @@ async function getImdbId(info) {
}
async function getKitsuId(title) {
return cacheWrapImdbId(title,
() => needle('get', `${KITSU_URL}/catalog/series/kitsu-anime-list/search=${title}.json`, { open_timeout: 60000 })
const query = title.replace(/[;]+/g, ' ').replace(/[,%']+/g, '');
return cacheWrapImdbId(query,
() => needle('get', `${KITSU_URL}/catalog/series/kitsu-anime-list/search=${query}.json`, { open_timeout: 60000 })
.then((response) => {
const body = response.body;
if (body && body.metas && body.metas.length) {