mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
improve firstmedia
This commit is contained in:
parent
66360221ff
commit
751fb1e7a5
2 changed files with 8 additions and 6 deletions
|
@ -1,13 +1,15 @@
|
||||||
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');
|
||||||
|
|
||||||
dayjs.extend(timezone);
|
dayjs.extend(timezone);
|
||||||
|
dayjs.extend(utc);
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
site: "firstmedia.com",
|
site: "firstmedia.com",
|
||||||
days: 2,
|
days: 1,
|
||||||
url: function ({ channel, date }) {
|
url: function ({ channel, date }) {
|
||||||
return `https://www.firstmedia.com/ajax/schedule?date=${
|
return `https://www.firstmedia.com/ajax/schedule?date=${date.format("DD/MM/YYYY")
|
||||||
date.format("DD/MM/YYYY")
|
|
||||||
}&channel=${channel.site_id}&start_time=1&end_time=24&need_channels=0`;
|
}&channel=${channel.site_id}&start_time=1&end_time=24&need_channels=0`;
|
||||||
},
|
},
|
||||||
parser: function ({ content, channel }) {
|
parser: function ({ content, channel }) {
|
||||||
|
@ -29,7 +31,7 @@ module.exports = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function parseItems(content, channel) {
|
function parseItems(content, channel) {
|
||||||
return JSON.parse(content).entries[channel];
|
return JSON.parse(content.trim()).entries[channel];
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseTitle(item) {
|
function parseTitle(item) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue