mirror of
https://github.com/iptv-org/epg
synced 2025-12-21 12:56:55 -05:00
wip
This commit is contained in:
21
config/ru/sites/tv.yandex.ru.js
Normal file
21
config/ru/sites/tv.yandex.ru.js
Normal file
@@ -0,0 +1,21 @@
|
||||
module.exports = {
|
||||
url: function ({ date, channel }) {
|
||||
return `https://tv.yandex.ru/channel/${channel.site_id}?date=${date.format('YYYY-MM-DD')}`
|
||||
},
|
||||
parser: function ({ channel, content }) {
|
||||
const initialState = content.match(/window.__INITIAL_STATE__ = (.*);/i)[1]
|
||||
const data = JSON.parse(initialState, null, 2)
|
||||
const programs = data.channel.schedule.events.map(i => {
|
||||
return {
|
||||
title: i.title,
|
||||
description: i.program.description,
|
||||
start: i.start,
|
||||
stop: i.finish,
|
||||
lang: 'ru',
|
||||
channel: channel['xmltv_id']
|
||||
}
|
||||
})
|
||||
|
||||
return programs
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user