mirror of
https://github.com/iptv-org/epg
synced 2025-12-18 11:27:06 -05:00
Skip all radio channels and duplicate channels
This commit is contained in:
@@ -41,23 +41,30 @@ module.exports = {
|
|||||||
.catch(console.error)
|
.catch(console.error)
|
||||||
|
|
||||||
const $ = cheerio.load(result)
|
const $ = cheerio.load(result)
|
||||||
const items = $('.home-content a').toArray()
|
const itemGroups = $('.home-content').toArray()
|
||||||
const channels = []
|
const channels = []
|
||||||
items.forEach(item => {
|
const processedIds = []
|
||||||
const $item = $(item)
|
|
||||||
|
|
||||||
const name = $item.find('p').text()
|
itemGroups.forEach(group => {
|
||||||
if (name.toUpperCase().indexOf('FM') < 0 && name.toUpperCase().indexOf('RADIO') < 0) {
|
const $group = $(group)
|
||||||
channels.push({
|
const props = $group.data('ahoy-props')
|
||||||
lang: 'id',
|
const name = props.content_title
|
||||||
site_id: $item.attr('href').substr($item.attr('href').lastIndexOf('/') + 1).split('-')[0],
|
const siteId = props.content_id
|
||||||
name
|
|
||||||
})
|
if (props.section.includes('Radio') || processedIds.includes(siteId)) {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
channels.push({
|
||||||
|
lang: 'id',
|
||||||
|
site_id: siteId,
|
||||||
|
name: name
|
||||||
|
})
|
||||||
|
processedIds.push(siteId)
|
||||||
})
|
})
|
||||||
|
|
||||||
return channels
|
return channels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseStart($item, date) {
|
function parseStart($item, date) {
|
||||||
|
|||||||
Reference in New Issue
Block a user