This commit is contained in:
freearhey
2021-03-12 02:49:09 +03:00
parent d06fa32f9d
commit cd22e3a477
12 changed files with 414 additions and 8 deletions

View File

@@ -2,7 +2,7 @@ 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 }) {
parser: function ({ channel, content, lang }) {
const initialState = content.match(/window.__INITIAL_STATE__ = (.*);/i)[1]
const data = JSON.parse(initialState, null, 2)
let programs = []
@@ -13,7 +13,7 @@ module.exports = {
description: i.program.description,
start: i.start,
stop: i.finish,
lang: 'ru',
lang,
channel: channel['xmltv_id']
}
})