mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Added channel logo parser
This commit is contained in:
parent
df9bc0b592
commit
0ccb18336d
5 changed files with 34 additions and 0 deletions
|
@ -15,6 +15,9 @@ module.exports = {
|
||||||
'YYYYMMDD'
|
'YYYYMMDD'
|
||||||
)}_${channel.site_id}.sjson`
|
)}_${channel.site_id}.sjson`
|
||||||
},
|
},
|
||||||
|
logo: function ({ channel }) {
|
||||||
|
return `http://www.mediaset.it/include/img/loghi/${channel.site_id}.png`
|
||||||
|
},
|
||||||
parser: function ({ content, date }) {
|
parser: function ({ content, date }) {
|
||||||
const programs = []
|
const programs = []
|
||||||
if (!content.events) return programs
|
if (!content.events) return programs
|
||||||
|
|
|
@ -22,6 +22,14 @@ module.exports = {
|
||||||
'YYYY-MM-DD'
|
'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 }) {
|
parser: function ({ content, date }) {
|
||||||
const programs = []
|
const programs = []
|
||||||
const dom = new JSDOM(content)
|
const dom = new JSDOM(content)
|
||||||
|
|
|
@ -11,6 +11,9 @@ module.exports = {
|
||||||
url: function ({ date }) {
|
url: function ({ date }) {
|
||||||
return `https://programacion-tv.elpais.com/data/parrilla_${date.format('DDMMYYYY')}.json`
|
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 }) {
|
parser: function ({ content, date, channel }) {
|
||||||
const programs = []
|
const programs = []
|
||||||
const channelData = content.find(i => i.idCanal === channel.site_id)
|
const channelData = content.find(i => i.idCanal === channel.site_id)
|
||||||
|
|
|
@ -20,6 +20,14 @@ module.exports = {
|
||||||
channel.site_id
|
channel.site_id
|
||||||
}.html`
|
}.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 }) {
|
parser: function ({ content, date }) {
|
||||||
const programs = []
|
const programs = []
|
||||||
const dom = new JSDOM(content)
|
const dom = new JSDOM(content)
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
const urlParser = require('url')
|
||||||
|
const jsdom = require('jsdom')
|
||||||
|
const { JSDOM } = jsdom
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
lang: 'ru',
|
lang: 'ru',
|
||||||
site: 'tv.yandex.ru',
|
site: 'tv.yandex.ru',
|
||||||
|
@ -9,6 +13,14 @@ module.exports = {
|
||||||
const [region, id] = channel.site_id.split('#')
|
const [region, id] = channel.site_id.split('#')
|
||||||
return `https://tv.yandex.ru/${region}/channel/${id}?date=${date.format('YYYY-MM-DD')}`
|
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 }) {
|
parser: function ({ content }) {
|
||||||
const initialState = content.match(/window.__INITIAL_STATE__ = (.*);/i)
|
const initialState = content.match(/window.__INITIAL_STATE__ = (.*);/i)
|
||||||
let programs = []
|
let programs = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue