encode slug ondebaixa

This commit is contained in:
TheBeastLT
2021-09-16 12:05:23 +02:00
committed by TheBeastLT
parent f2604aed6d
commit d2b01e7727

View File

@@ -21,7 +21,7 @@ function torrent(torrentId, config = {}, retries = 2) {
if (!torrentId || retries === 0) {
return Promise.reject(new Error(`Failed ${torrentId} query`));
}
const slug = torrentId.split("/")[3];
const slug = encodeURIComponent(torrentId.split("/")[3]);
return singleRequest(`${baseUrl}/${slug}/`, config)
.then((body) => parseTorrentPage(body))
.then((torrent) => torrent.map(el => ({ torrentId: slug, ...el })))