mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update /sites
This commit is contained in:
parent
ca254a6df0
commit
c0cfcf7a47
543 changed files with 30781 additions and 31187 deletions
|
@ -18,7 +18,7 @@ module.exports = {
|
|||
'X-Requested-With': 'XMLHttpRequest'
|
||||
}
|
||||
},
|
||||
parser: function ({ content, channel, date }) {
|
||||
parser: function ({ content, channel }) {
|
||||
let programs = []
|
||||
const data = parseContent(content, channel)
|
||||
const items = parseItems(data)
|
||||
|
@ -38,21 +38,23 @@ module.exports = {
|
|||
}
|
||||
|
||||
function parseContent(content, channel) {
|
||||
const [_, site_id] = channel.site_id.split('#')
|
||||
const [, site_id] = channel.site_id.split('#')
|
||||
let data
|
||||
try {
|
||||
data = JSON.parse(content)
|
||||
} catch (e) {}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
if (!data || !data.channels || !data.channels.length) return null
|
||||
|
||||
return data.channels.find(c => c.id === site_id) || null
|
||||
}
|
||||
|
||||
function parseStart(item, date) {
|
||||
function parseStart(item) {
|
||||
return dayjs.tz(item.full_start, 'Europe/Belgrade')
|
||||
}
|
||||
|
||||
function parseStop(item, date) {
|
||||
function parseStop(item) {
|
||||
return dayjs.tz(item.full_end, 'Europe/Belgrade')
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue