mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
encode slug ondebaixa
This commit is contained in:
@@ -21,7 +21,7 @@ function torrent(torrentId, config = {}, retries = 2) {
|
|||||||
if (!torrentId || retries === 0) {
|
if (!torrentId || retries === 0) {
|
||||||
return Promise.reject(new Error(`Failed ${torrentId} query`));
|
return Promise.reject(new Error(`Failed ${torrentId} query`));
|
||||||
}
|
}
|
||||||
const slug = torrentId.split("/")[3];
|
const slug = encodeURIComponent(torrentId.split("/")[3]);
|
||||||
return singleRequest(`${baseUrl}/${slug}/`, config)
|
return singleRequest(`${baseUrl}/${slug}/`, config)
|
||||||
.then((body) => parseTorrentPage(body))
|
.then((body) => parseTorrentPage(body))
|
||||||
.then((torrent) => torrent.map(el => ({ torrentId: slug, ...el })))
|
.then((torrent) => torrent.map(el => ({ torrentId: slug, ...el })))
|
||||||
|
|||||||
Reference in New Issue
Block a user