This commit is contained in:
freearhey
2021-03-13 15:51:19 +03:00
parent 40dcba7a3e
commit 980019968e
14 changed files with 54 additions and 11882 deletions

View File

@@ -1,7 +1,7 @@
module.exports = {
site: 'tv.yandex.ru',
lang: 'ru',
output: '../../.gh-pages/guides/tv.yandex.ru.xml',
site: 'tv.yandex.ru',
output: '.gh-pages/guides/tv.yandex.ru.xml',
cookie:
'yandexuid=8747786251615498142; Expires=Tue, 11 Mar 2031 21:29:02 GMT; Domain=yandex.ru; Path=/',
url: function ({ date, channel }) {
@@ -10,7 +10,8 @@ module.exports = {
parser: function ({ channel, content, lang }) {
const initialState = content.match(/window.__INITIAL_STATE__ = (.*);/i)
let programs = []
if (initialState && initialState[1]) return programs
if (!initialState && !initialState[1]) return programs
const data = JSON.parse(initialState[1], null, 2)
if (data.channel) {
programs = data.channel.schedule.events.map(i => {