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 utc = require('dayjs/plugin/utc')
|
||||||
const timezone = require('dayjs/plugin/timezone')
|
const timezone = require('dayjs/plugin/timezone')
|
||||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||||
var convert = require('xml-js');
|
const convert = require('xml-js')
|
||||||
|
|
||||||
dayjs.extend(utc)
|
dayjs.extend(utc)
|
||||||
dayjs.extend(timezone)
|
dayjs.extend(timezone)
|
||||||
dayjs.extend(customParseFormat)
|
dayjs.extend(customParseFormat)
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
site: 'skylink.cz',
|
site: 'mujtvprogram.cz',
|
||||||
url({ channel, date }) {
|
url({ channel, date }) {
|
||||||
const diff = date.diff(dayjs.utc().startOf('d'), 'd')
|
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}`
|
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) {
|
function parseItems(content) {
|
||||||
try {
|
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 []
|
if (!data) return []
|
||||||
const programmes = data['tv-program-programmes'].programme
|
const programmes = data['tv-program-programmes'].programme
|
||||||
return programmes && Array.isArray(programmes) ? programmes : []
|
return programmes && Array.isArray(programmes) ? programmes : []
|
||||||
|
@ -49,7 +53,6 @@ function parseDescription(item) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function parseList(list) {
|
function parseList(list) {
|
||||||
if (!list) return []
|
if (!list) return []
|
||||||
if (!list._text) return []
|
if (!list._text) return []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue