mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-11 01:20:08 -04:00
Update zap2it.com.config.js
This commit is contained in:
parent
acc5f21587
commit
1cecb1ec04
1 changed files with 11 additions and 13 deletions
|
@ -1,13 +1,11 @@
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
const timezone = require('dayjs/plugin/timezone')
|
const timezone = require('dayjs/plugin/timezone')
|
||||||
const utc = require('dayjs/plugin/utc');
|
const utc = require('dayjs/plugin/utc')
|
||||||
const isBetween = require('dayjs/plugin/isBetween')
|
const isBetween = require('dayjs/plugin/isBetween')
|
||||||
|
|
||||||
dayjs.extend(timezone);
|
dayjs.extend(timezone)
|
||||||
dayjs.extend(utc);
|
dayjs.extend(utc)
|
||||||
dayjs.extend(isBetween);
|
dayjs.extend(isBetween)
|
||||||
|
|
||||||
const localTimezone = dayjs.tz.guess()
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
site: 'zap2it.com',
|
site: 'zap2it.com',
|
||||||
|
@ -45,12 +43,12 @@ module.exports = {
|
||||||
DSTStart: '2025-03-09T02:00Z',
|
DSTStart: '2025-03-09T02:00Z',
|
||||||
DSTEnd: '2025-11-02T02:00Z',
|
DSTEnd: '2025-11-02T02:00Z',
|
||||||
languagecode: 'en-us',
|
languagecode: 'en-us',
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
parser: function ({ content, date }) {
|
parser: function ({ content, date }) {
|
||||||
const data = JSON.parse(content);
|
const data = JSON.parse(content)
|
||||||
const programs = [];
|
const programs = []
|
||||||
|
|
||||||
Object.keys(data).forEach(dateKey => {
|
Object.keys(data).forEach(dateKey => {
|
||||||
data[dateKey].forEach(item => {
|
data[dateKey].forEach(item => {
|
||||||
|
@ -66,10 +64,10 @@ module.exports = {
|
||||||
season: item.program.season || '',
|
season: item.program.season || '',
|
||||||
episode: item.program.episode || '',
|
episode: item.program.episode || '',
|
||||||
date: item.program.releaseYear || '',
|
date: item.program.releaseYear || '',
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|
||||||
return programs.filter(p => dayjs(p.start).isBetween(date.startOf('day').utc(), date.endOf('day').utc(), 'second', '[]'))
|
return programs.filter(p => dayjs(p.start).isBetween(date.startOf('day').utc(), date.endOf('day').utc(), 'second', '[]'))
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue