mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Update mujtvprogram.cz.config.js
This commit is contained in:
parent
1d3eead257
commit
483ed740c5
1 changed files with 45 additions and 42 deletions
|
@ -2,14 +2,14 @@ const dayjs = require('dayjs')
|
|||
const utc = require('dayjs/plugin/utc')
|
||||
const timezone = require('dayjs/plugin/timezone')
|
||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||
var convert = require('xml-js');
|
||||
const convert = require('xml-js')
|
||||
|
||||
dayjs.extend(utc)
|
||||
dayjs.extend(timezone)
|
||||
dayjs.extend(customParseFormat)
|
||||
|
||||
module.exports = {
|
||||
site: 'skylink.cz',
|
||||
site: 'mujtvprogram.cz',
|
||||
url({ channel, date }) {
|
||||
const diff = date.diff(dayjs.utc().startOf('d'), 'd')
|
||||
return `https://services.mujtvprogram.cz/tvprogram2services/services/tvprogrammelist_mobile.php?channel_cid=${channel.site_id}&day=${diff}`
|
||||
|
@ -35,7 +35,11 @@ module.exports = {
|
|||
|
||||
function parseItems(content) {
|
||||
try {
|
||||
const data = convert.xml2js(content, {compact: true, ignoreDeclaration: true, ignoreAttributes:true})
|
||||
const data = convert.xml2js(content, {
|
||||
compact: true,
|
||||
ignoreDeclaration: true,
|
||||
ignoreAttributes: true
|
||||
})
|
||||
if (!data) return []
|
||||
const programmes = data['tv-program-programmes'].programme
|
||||
return programmes && Array.isArray(programmes) ? programmes : []
|
||||
|
@ -49,7 +53,6 @@ function parseDescription(item) {
|
|||
return null
|
||||
}
|
||||
|
||||
|
||||
function parseList(list) {
|
||||
if (!list) return []
|
||||
if (!list._text) return []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue