Update abc.net.au.config.js

This commit is contained in:
freearhey 2025-02-02 06:29:01 +03:00
parent 2932771e91
commit f4fec9896e

View file

@ -19,7 +19,7 @@ module.exports = {
url({ date, channel }) { url({ date, channel }) {
const [region] = channel.site_id.split('#') const [region] = channel.site_id.split('#')
return `https://epg.abctv.net.au/processed/${region}_${date.format('YYYY-MM-DD')}.json` return `https://cdn.iview.abc.net.au/epg/processed/${region}_${date.format('YYYY-MM-DD')}.json`
}, },
parser({ content, channel }) { parser({ content, channel }) {
let programs = [] let programs = []
@ -41,42 +41,43 @@ module.exports = {
return programs return programs
}, },
async channels() { async channels({ region = 'syd' }) {
const now = dayjs() const now = dayjs()
const regions = [ const regions = {
'Sydney', syd: 'Sydney',
'Melbourne', mel: 'Melbourne',
'Brisbane', bri: 'Brisbane',
'GoldCoast', gc: 'GoldCoast',
'Perth', per: 'Perth',
'Adelaide', adl: 'Adelaide',
'Hobart', hbr: 'Hobart',
'Darwin', drw: 'Darwin',
'Canberra', cbr: 'Canberra',
'New South Wales', nsw: 'New South Wales',
'Victoria', vic: 'Victoria',
'Townsville', tsv: 'Townsville',
'Queensland', qld: 'Queensland',
'Western Australia', wa: 'Western Australia',
'South Australia', sa: 'South Australia',
'Tasmania', tas: 'Tasmania',
'Northern Territory' nt: 'Northern Territory'
] }
let channels = [] let channels = []
for (let region of regions) { const regionName = regions[region]
const data = await axios const data = await axios
.get(`https://epg.abctv.net.au/processed/${region}_${now.format('YYYY-MM-DD')}.json`) .get(
.then(r => r.data) `https://cdn.iview.abc.net.au/epg/processed/${regionName}_${now.format('YYYY-MM-DD')}.json`
.catch(console.log) )
.then(r => r.data)
.catch(console.log)
for (let item of data.schedule) { for (let item of data.schedule) {
channels.push({ channels.push({
lang: 'en', lang: 'en',
site_id: `${region}#${item.channel}`, site_id: `${regionName}#${item.channel}`,
name: item.channel name: item.channel
}) })
}
} }
return channels return channels