mirror of
https://github.com/iptv-org/epg
synced 2026-04-29 22:16:59 -04:00
Update /sites
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<site site="toonamiaftermath.com">
|
||||
<channels>
|
||||
<channel lang="en" xmltv_id="ToonamiAftermathEast.us" site_id="Toonami Aftermath EST">Toonami Aftermath East</channel>
|
||||
</channels>
|
||||
</site>
|
||||
<channels>
|
||||
<channel site="toonamiaftermath.com" lang="en" xmltv_id="ToonamiAftermathEast.us" site_id="Toonami Aftermath EST">Toonami Aftermath East</channel>
|
||||
</channels>
|
||||
|
||||
@@ -3,7 +3,7 @@ process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0'
|
||||
const dayjs = require('dayjs')
|
||||
const axios = require('axios')
|
||||
|
||||
const API_ENDPOINT = `https://api.toonamiaftermath.com`
|
||||
const API_ENDPOINT = 'https://api.toonamiaftermath.com'
|
||||
|
||||
module.exports = {
|
||||
site: 'toonamiaftermath.com',
|
||||
@@ -22,7 +22,7 @@ module.exports = {
|
||||
|
||||
return `${API_ENDPOINT}/playlist?id=${playlist._id}&addInfo=true`
|
||||
},
|
||||
parser({ content, date }) {
|
||||
parser({ content }) {
|
||||
let programs = []
|
||||
const items = parseItems(content)
|
||||
items.forEach(item => {
|
||||
@@ -44,18 +44,17 @@ function parseItems(content) {
|
||||
const data = JSON.parse(content)
|
||||
if (!data || !data.playlist) return []
|
||||
|
||||
return data.playlist.blocks
|
||||
.reduce((acc, curr) => {
|
||||
acc = acc.concat(curr.mediaList)
|
||||
return data.playlist.blocks.reduce((acc, curr) => {
|
||||
acc = acc.concat(curr.mediaList)
|
||||
|
||||
return acc
|
||||
}, [])
|
||||
return acc
|
||||
}, [])
|
||||
}
|
||||
|
||||
function parseEpisode(item) {
|
||||
return (item && item.info && item.info.episode) ? item.info.episode : null
|
||||
return item && item.info && item.info.episode ? item.info.episode : null
|
||||
}
|
||||
|
||||
function parseIcon(item) {
|
||||
return (item && item.info && item.info.image) ? item.info.image : null
|
||||
}
|
||||
return item && item.info && item.info.image ? item.info.image : null
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// npx epg-grabber --config=sites/toonamiaftermath.com/toonamiaftermath.com.config.js --channels=sites/toonamiaftermath.com/toonamiaftermath.com.channels.xml --output=guide.xml --days=2
|
||||
// npm run grab -- --site=toonamiaftermath.com
|
||||
|
||||
const { parser, url, request } = require('./toonamiaftermath.com.config.js')
|
||||
const { parser, url } = require('./toonamiaftermath.com.config.js')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const axios = require('axios')
|
||||
@@ -12,7 +12,7 @@ dayjs.extend(utc)
|
||||
|
||||
jest.mock('axios')
|
||||
|
||||
const API_ENDPOINT = `https://api.toonamiaftermath.com`
|
||||
const API_ENDPOINT = 'https://api.toonamiaftermath.com'
|
||||
|
||||
const date = dayjs.utc('2022-11-29', 'YYYY-MM-DD').startOf('d')
|
||||
const channel = {
|
||||
|
||||
Reference in New Issue
Block a user