diff --git a/sites/epg.112114.xyz/epg.112114.xyz.channels.xml b/sites/epg.112114.xyz/epg.112114.xyz.channels.xml index fa56c390..0fe370f4 100644 --- a/sites/epg.112114.xyz/epg.112114.xyz.channels.xml +++ b/sites/epg.112114.xyz/epg.112114.xyz.channels.xml @@ -20,7 +20,6 @@ CCTV3 CCTV4 CCTV4K - CCTV4K CCTV4欧洲 CCTV4美洲 CCTV5 @@ -539,10 +538,8 @@ 民视新闻台 求索动物 求索生活 - 求索生活 求索科学 求索纪录 - 求索纪录 求索记录 汉语体育健康 汉语经济生活 diff --git a/sites/epg.112114.xyz/epg.112114.xyz.config.js b/sites/epg.112114.xyz/epg.112114.xyz.config.js index e512fa20..469a89cd 100644 --- a/sites/epg.112114.xyz/epg.112114.xyz.config.js +++ b/sites/epg.112114.xyz/epg.112114.xyz.config.js @@ -27,14 +27,23 @@ module.exports = { const data = await axios .get('https://epg.112114.xyz/pp.xml') .then(r => r.data) - .catch(console.log) - const { channels } = parser.parse(data) + .catch(e => { console.log(e); return null }) + if (!data) return [] - return channels.map(channel => ({ - lang: 'zh', - site_id: channel.id, - name: channel.displayName[0].value - })) + const { channels = [] } = parser.parse(data) + + const seen = new Set() + return channels + .filter(ch => { + if (seen.has(ch.id)) return false + seen.add(ch.id) + return true + }) + .map(channel => ({ + lang: 'zh', + site_id: channel.id, + name: channel.displayName?.[0]?.value || '' + })) } }