feat(rutor): category rutor
This commit is contained in:
@ -127,11 +127,23 @@ module.exports = class Rutor
|
|||||||
if(!topicTitle)
|
if(!topicTitle)
|
||||||
return
|
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 {
|
return {
|
||||||
name: topicTitle,
|
name: topicTitle,
|
||||||
poster: $('#details tbody img').attr('src'),
|
poster: $('#details tbody img').attr('src'),
|
||||||
description: $('#details tbody').first().text(),
|
description: $('#details tbody').first().text(),
|
||||||
rutorThreadId: parseInt(id)
|
rutorThreadId: parseInt(id),
|
||||||
|
contentCategory
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ describe("rutor", () => {
|
|||||||
const data = await rutor.findHash('158448f6afbedb079aaf3c4695fb43e7dfa54515')
|
const data = await rutor.findHash('158448f6afbedb079aaf3c4695fb43e7dfa54515')
|
||||||
assert.equal(data.name, 'Наруто: Ураганные Хроники / Naruto Shippuuden Movie [4 фильм] (2007) DVDRip')
|
assert.equal(data.name, 'Наруто: Ураганные Хроники / Naruto Shippuuden Movie [4 фильм] (2007) DVDRip')
|
||||||
assert.equal(data.rutorThreadId, 5850)
|
assert.equal(data.rutorThreadId, 5850)
|
||||||
|
assert.equal(data.contentCategory, 'Аниме')
|
||||||
})
|
})
|
||||||
|
|
||||||
it("notFound", async function() {
|
it("notFound", async function() {
|
||||||
|
Reference in New Issue
Block a user