mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Bug fix: need to return the promise
This commit is contained in:
parent
420807769d
commit
6988c53c12
1 changed files with 13 additions and 14 deletions
|
@ -61,10 +61,9 @@ module.exports = {
|
||||||
title: item.displayNm,
|
title: item.displayNm,
|
||||||
start: parseStart(item),
|
start: parseStart(item),
|
||||||
stop: parseStop(item),
|
stop: parseStop(item),
|
||||||
icon: programDetail.image[0].url,
|
icon: programDetail ? programDetail.image[0].url : '',
|
||||||
category: programDetail.category_Info[0].title,
|
category: programDetail ? programDetail.category_Info[0].title : '',
|
||||||
description: programDetail.content[0].text
|
description: programDetail ? programDetail.content[0].text : ''
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +89,7 @@ function parseStop(item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function parseProgramDetail(item) {
|
async function parseProgramDetail(item) {
|
||||||
const data = await axios.post(
|
return axios.post(
|
||||||
'https://www.arirang.com/v1.0/open/program/detail',
|
'https://www.arirang.com/v1.0/open/program/detail',
|
||||||
{
|
{
|
||||||
'bis_program_code': item.pgmCd
|
'bis_program_code': item.pgmCd
|
||||||
|
@ -102,13 +101,13 @@ async function parseProgramDetail(item) {
|
||||||
'Origin': 'https://www.arirang.com',
|
'Origin': 'https://www.arirang.com',
|
||||||
'Referer': 'https://www.arirang.com/schedule',
|
'Referer': 'https://www.arirang.com/schedule',
|
||||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36'
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36'
|
||||||
}
|
},
|
||||||
})
|
timeout: 5000,
|
||||||
.then(r => r.data)
|
cache: { ttl: 60 * 1000 },
|
||||||
.catch()
|
}
|
||||||
|
).then(function (response) {
|
||||||
if (!data)
|
return response.data
|
||||||
return {}
|
}).catch(function (error) {
|
||||||
|
// console.log(error)
|
||||||
return data
|
})
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue