mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 17:10:07 -04:00
Skip all radio channels and duplicate channels
This commit is contained in:
parent
270e85cfae
commit
1ccb266519
1 changed files with 18 additions and 11 deletions
|
@ -41,19 +41,26 @@ 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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue