mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
pads tpb info imdbId with zeros
This commit is contained in:
@@ -187,7 +187,7 @@ function parseTorrentPage(body) {
|
|||||||
}
|
}
|
||||||
const details = $('div[id=\'details\']');
|
const details = $('div[id=\'details\']');
|
||||||
const col1 = details.find('dl[class=\'col1\']');
|
const col1 = details.find('dl[class=\'col1\']');
|
||||||
const imdbIdMatch = col1.html().match(/imdb\.com\/title\/(tt\d+)/i);
|
const imdbIdMatch = col1.html().match(/imdb\.com\/title\/tt(\d+)/i);
|
||||||
|
|
||||||
const torrent = {
|
const torrent = {
|
||||||
name: $('div[id=\'title\']').text().trim(),
|
name: $('div[id=\'title\']').text().trim(),
|
||||||
@@ -198,7 +198,7 @@ function parseTorrentPage(body) {
|
|||||||
subcategory: parseInt(col1.find('a[title=\'More from this category\']').eq(0).attr('href').match(/\d+$/)[0], 10),
|
subcategory: parseInt(col1.find('a[title=\'More from this category\']').eq(0).attr('href').match(/\d+$/)[0], 10),
|
||||||
size: parseSize(details.find('dt:contains(\'Size:\')').next().text().match(/(\d+)(?:.?Bytes)/)[1]),
|
size: parseSize(details.find('dt:contains(\'Size:\')').next().text().match(/(\d+)(?:.?Bytes)/)[1]),
|
||||||
uploadDate: new Date(details.find('dt:contains(\'Uploaded:\')').next().text()),
|
uploadDate: new Date(details.find('dt:contains(\'Uploaded:\')').next().text()),
|
||||||
imdbId: imdbIdMatch && imdbIdMatch[1]
|
imdbId: imdbIdMatch && `tt${imdbIdMatch[1].padStart(7, '0')}`
|
||||||
};
|
};
|
||||||
resolve(torrent);
|
resolve(torrent);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user