This commit is contained in:
freearhey
2021-03-11 18:17:24 +03:00
parent d0acdd8de7
commit 158c318d99
12 changed files with 147 additions and 11444 deletions

24
sites/tv.yandex.ru.js Normal file
View File

@@ -0,0 +1,24 @@
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)
let programs = []
if (data.channel) {
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
}
}