fix(rutracker): encoding fix
This commit is contained in:
@ -22,7 +22,7 @@ module.exports = class Nyaa
|
|||||||
}
|
}
|
||||||
if(!html)
|
if(!html)
|
||||||
return
|
return
|
||||||
html = await html.text()
|
html = await html.textConverted()
|
||||||
const $ = cheerio.load(html)
|
const $ = cheerio.load(html)
|
||||||
let topicTitle = $('.panel-title').first().text()
|
let topicTitle = $('.panel-title').first().text()
|
||||||
if(!topicTitle)
|
if(!topicTitle)
|
||||||
|
@ -22,7 +22,7 @@ module.exports = class Rutracker
|
|||||||
}
|
}
|
||||||
if(!html)
|
if(!html)
|
||||||
return
|
return
|
||||||
html = await html.text()
|
html = await html.textConverted()
|
||||||
const $ = cheerio.load(html)
|
const $ = cheerio.load(html)
|
||||||
const topicTitle = $('#topic-title').text()
|
const topicTitle = $('#topic-title').text()
|
||||||
if(!topicTitle)
|
if(!topicTitle)
|
||||||
|
@ -5,13 +5,13 @@ describe("nyaa", () => {
|
|||||||
let nyaa = new Nyaa();
|
let nyaa = new Nyaa();
|
||||||
|
|
||||||
it("findHash", async function() {
|
it("findHash", async function() {
|
||||||
this.timeout(10000)
|
this.timeout(5000)
|
||||||
const data = await nyaa.findHash('b57cc972ecc31dd31e9349017e5d26c164e08906')
|
const data = await nyaa.findHash('b57cc972ecc31dd31e9349017e5d26c164e08906')
|
||||||
assert.equal(data.name, '[HorribleSubs] One Piece - 794 [1080p].mkv')
|
assert.equal(data.name, '[HorribleSubs] One Piece - 794 [1080p].mkv')
|
||||||
})
|
})
|
||||||
|
|
||||||
it("notFound", async function() {
|
it("notFound", async function() {
|
||||||
this.timeout(10000)
|
this.timeout(5000)
|
||||||
assert(!await nyaa.findHash('FFEDA8DF683F34A08BE89026114E6C05F881DCC0'))
|
assert(!await nyaa.findHash('FFEDA8DF683F34A08BE89026114E6C05F881DCC0'))
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@ -20,5 +20,6 @@ describe("rutracker", () => {
|
|||||||
assert.equal(data.name, '(Doom metal / Melodic metal / Instrumental) Folie A Deux - Demo - 2012, MP3, 128-320 kbps')
|
assert.equal(data.name, '(Doom metal / Melodic metal / Instrumental) Folie A Deux - Demo - 2012, MP3, 128-320 kbps')
|
||||||
assert.equal(data.poster, 'http://i44.fastpic.ru/big/2012/1018/a2/4e8740f608387b32b74c5deea72d05a2.jpg')
|
assert.equal(data.poster, 'http://i44.fastpic.ru/big/2012/1018/a2/4e8740f608387b32b74c5deea72d05a2.jpg')
|
||||||
assert.equal(data.rutrackerThreadId, 4220109)
|
assert.equal(data.rutrackerThreadId, 4220109)
|
||||||
|
assert(data.description.includes('выхода'))
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user