Update update-readme.js

This commit is contained in:
freearhey 2021-01-27 18:33:14 +03:00
parent d208ba0de9
commit ec94896608
1 changed files with 9 additions and 6 deletions

View File

@ -26,6 +26,15 @@ function parseIndex() {
let countries = {} let countries = {}
let languages = {} let languages = {}
let categories = {} let categories = {}
for (let categoryCode in helper.supportedCategories) {
categories[categoryCode] = {
category: helper.supportedCategories[categoryCode],
channels: 0,
playlist: `<code>https://iptv-org.github.io/iptv/categories/${categoryCode}.m3u</code>`
}
}
for (let rootItem of root.items) { for (let rootItem of root.items) {
const playlist = helper.parsePlaylist(rootItem.url) const playlist = helper.parsePlaylist(rootItem.url)
const countryName = rootItem.name const countryName = rootItem.name
@ -74,12 +83,6 @@ function parseIndex() {
const categoryCode = categoryName.toLowerCase() const categoryCode = categoryName.toLowerCase()
if (categories[categoryCode]) { if (categories[categoryCode]) {
categories[categoryCode].channels++ categories[categoryCode].channels++
} else {
categories[categoryCode] = {
category: categoryName,
channels: 1,
playlist: `<code>https://iptv-org.github.io/iptv/categories/${categoryCode}.m3u</code>`
}
} }
} }
} }