wip
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user