mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
add torrent9 provider
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const { si } = require('nyaapi')
|
||||
const { parseSize } = require("../scraperHelper");
|
||||
|
||||
const Categories = {
|
||||
ANIME: {
|
||||
@@ -62,19 +63,4 @@ function parseTorrent(torrent) {
|
||||
}
|
||||
}
|
||||
|
||||
function parseSize(sizeText) {
|
||||
if (!sizeText) {
|
||||
return undefined;
|
||||
}
|
||||
let scale = 1;
|
||||
if (sizeText.includes('GiB')) {
|
||||
scale = 1024 * 1024 * 1024
|
||||
} else if (sizeText.includes('MiB')) {
|
||||
scale = 1024 * 1024;
|
||||
} else if (sizeText.includes('KiB') || sizeText.includes('kB')) {
|
||||
scale = 1024;
|
||||
}
|
||||
return Math.floor(parseFloat(sizeText.replace(/[',]/g, '')) * scale);
|
||||
}
|
||||
|
||||
module.exports = { torrent, search, browse, Categories };
|
||||
|
||||
Reference in New Issue
Block a user