diff --git a/sites/mediaset.it.config.js b/sites/mediaset.it.config.js index 82d71f01..7e69cb0f 100644 --- a/sites/mediaset.it.config.js +++ b/sites/mediaset.it.config.js @@ -15,6 +15,9 @@ module.exports = { 'YYYYMMDD' )}_${channel.site_id}.sjson` }, + logo: function ({ channel }) { + return `http://www.mediaset.it/include/img/loghi/${channel.site_id}.png` + }, parser: function ({ content, date }) { const programs = [] if (!content.events) return programs diff --git a/sites/ontvtonight.com.config.js b/sites/ontvtonight.com.config.js index 5849b904..544f0953 100644 --- a/sites/ontvtonight.com.config.js +++ b/sites/ontvtonight.com.config.js @@ -22,6 +22,14 @@ module.exports = { 'YYYY-MM-DD' )}` }, + logo: function ({ content }) { + const dom = new JSDOM(content) + const img = + dom.window.document.querySelector('#content > div > div > div.span6 > img') || + dom.window.document.querySelector('#inner-headline > div > div > div > img') + + return img ? img.src : null + }, parser: function ({ content, date }) { const programs = [] const dom = new JSDOM(content) diff --git a/sites/programacion-tv.elpais.com.config.js b/sites/programacion-tv.elpais.com.config.js index 3bd1b1e0..68877673 100644 --- a/sites/programacion-tv.elpais.com.config.js +++ b/sites/programacion-tv.elpais.com.config.js @@ -11,6 +11,9 @@ module.exports = { url: function ({ date }) { return `https://programacion-tv.elpais.com/data/parrilla_${date.format('DDMMYYYY')}.json` }, + logo: function ({ channel }) { + return `https://programacion-tv.elpais.com/imagenes/canales/${channel.site_id}.jpg` + }, parser: function ({ content, date, channel }) { const programs = [] const channelData = content.find(i => i.idCanal === channel.site_id) diff --git a/sites/programme-tv.net.config.js b/sites/programme-tv.net.config.js index b1dfac24..b4a9ebfc 100644 --- a/sites/programme-tv.net.config.js +++ b/sites/programme-tv.net.config.js @@ -20,6 +20,14 @@ module.exports = { channel.site_id }.html` }, + logo: function ({ content }) { + const dom = new JSDOM(content) + const img = dom.window.document.querySelector( + '#corps > div > div.page.channel > div.gridChannel > div.gridChannel-leftColumn > div.gridChannel-epgGrid > div.gridChannel-header > div > div > div > img' + ) + + return img ? img.dataset.src : null + }, parser: function ({ content, date }) { const programs = [] const dom = new JSDOM(content) diff --git a/sites/tv.yandex.ru.config.js b/sites/tv.yandex.ru.config.js index 308e608d..b9e97429 100644 --- a/sites/tv.yandex.ru.config.js +++ b/sites/tv.yandex.ru.config.js @@ -1,3 +1,7 @@ +const urlParser = require('url') +const jsdom = require('jsdom') +const { JSDOM } = jsdom + module.exports = { lang: 'ru', site: 'tv.yandex.ru', @@ -9,6 +13,14 @@ module.exports = { const [region, id] = channel.site_id.split('#') return `https://tv.yandex.ru/${region}/channel/${id}?date=${date.format('YYYY-MM-DD')}` }, + logo: function ({ content }) { + const dom = new JSDOM(content) + const img = dom.window.document.querySelector( + '#mount > div > main > div > div > div.content__header > div > div.channel-header__title > figure > img' + ) + + return img ? 'https:' + img.src : null + }, parser: function ({ content }) { const initialState = content.match(/window.__INITIAL_STATE__ = (.*);/i) let programs = []