fix(1337x): proper poster in some cases

This commit is contained in:
Alexey Kasyanchuk 2019-01-26 15:27:53 +03:00
parent eb5f7a7f41
commit db3c6faab2
2 changed files with 12 additions and 1 deletions

View File

@ -47,9 +47,13 @@ module.exports = class Stragegie
contentCategory = $('.torrent-category-detail .list li').first().find('span').text() contentCategory = $('.torrent-category-detail .list li').first().find('span').text()
} catch(er) {} } catch(er) {}
let poster = $('.torrent-image img').attr('src') || $('#description img').attr('data-original');
if(poster)
poster = poster.replace(/^\/\//, 'https://');
return { return {
name: topicTitle.trim(), name: topicTitle.trim(),
poster: $('#description img').attr('data-original'), poster,
description: $('#description').text(), description: $('#description').text(),
x1337ThreadId: parseInt(this.id), x1337ThreadId: parseInt(this.id),
x1337Href: this.href, x1337Href: this.href,

View File

@ -14,6 +14,13 @@ describe("1337x", () => {
assert.equal(data.contentCategory, 'Music') assert.equal(data.contentCategory, 'Music')
}) })
it("properFilmPoster", async function() {
this.timeout(8000);
const data = await strategy.findHash('BA696FB753078807B696A6F1DA5D8DD24F43BE04')
assert.equal(data.name, 'Tears of the Sun (2003) [720p] [BluRay] [YTS.ME] [YIFY]')
assert.equal(data.poster, 'https://lx1.dyncdn.cc/cdn/89/891b2655428e3016e1fe648539e22220.jpg')
})
it("notFound", async function() { it("notFound", async function() {
assert(!await strategy.findHash('1734BCCAA7B05BD4D77B86E17820C840BF0C2EF6')) assert(!await strategy.findHash('1734BCCAA7B05BD4D77B86E17820C840BF0C2EF6'))
}) })