mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update abc.net.au.config.js
This commit is contained in:
parent
2932771e91
commit
f4fec9896e
1 changed files with 34 additions and 33 deletions
|
@ -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,43 +41,44 @@ 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(
|
||||||
|
`https://cdn.iview.abc.net.au/epg/processed/${regionName}_${now.format('YYYY-MM-DD')}.json`
|
||||||
|
)
|
||||||
.then(r => r.data)
|
.then(r => r.data)
|
||||||
.catch(console.log)
|
.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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue