feat(rutor): category rutor
This commit is contained in:
parent
0521b7ea02
commit
429263e61e
@ -127,11 +127,23 @@ module.exports = class Rutor
|
||||
if(!topicTitle)
|
||||
return
|
||||
|
||||
let contentCategory
|
||||
$('#details tr').each(function(i, elem) {
|
||||
const row = $(this)
|
||||
const field = row.find('td.header').text()
|
||||
if(field == 'Категория')
|
||||
{
|
||||
contentCategory = row.find('td').next().text().trim()
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return {
|
||||
name: topicTitle,
|
||||
poster: $('#details tbody img').attr('src'),
|
||||
description: $('#details tbody').first().text(),
|
||||
rutorThreadId: parseInt(id)
|
||||
rutorThreadId: parseInt(id),
|
||||
contentCategory
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ describe("rutor", () => {
|
||||
const data = await rutor.findHash('158448f6afbedb079aaf3c4695fb43e7dfa54515')
|
||||
assert.equal(data.name, 'Наруто: Ураганные Хроники / Naruto Shippuuden Movie [4 фильм] (2007) DVDRip')
|
||||
assert.equal(data.rutorThreadId, 5850)
|
||||
assert.equal(data.contentCategory, 'Аниме')
|
||||
})
|
||||
|
||||
it("notFound", async function() {
|
||||
|
Loading…
Reference in New Issue
Block a user