This commit is contained in:
freearhey
2021-03-11 23:36:44 +03:00
parent 40f76efda9
commit 448c47cb5c
8 changed files with 201 additions and 10078 deletions

View File

@@ -3,6 +3,7 @@ const { JSDOM } = jsdom
const dayjs = require('dayjs')
var customParseFormat = require('dayjs/plugin/customParseFormat')
dayjs.extend(customParseFormat)
const { htmlToText } = require('html-to-text')
module.exports = {
url: function ({ date, channel }) {
@@ -21,6 +22,8 @@ module.exports = {
const title = (tr.getElementsByClassName('title')[0] || { innerHTML: '' }).innerHTML
.toString()
.trim()
const detail = tr.getElementsByClassName('detail')[0] || { innerHTML: '' }
const description = htmlToText(detail.innerHTML)
if (time && title) {
const start = dayjs(time, 'h:mma')
@@ -31,7 +34,7 @@ module.exports = {
programs.push({
title,
description: null,
description,
start,
stop: null,
lang: 'en',