diff --git a/.readme/_categories.md b/.readme/_categories.md index f05e42ac6..1979aa05c 100644 --- a/.readme/_categories.md +++ b/.readme/_categories.md @@ -32,6 +32,6 @@ Travel8https://iptv-org.github.io/iptv/categories/travel.m3u Weather4https://iptv-org.github.io/iptv/categories/weather.m3u XXX70https://iptv-org.github.io/iptv/categories/xxx.m3u - Other2844https://iptv-org.github.io/iptv/categories/other.m3u + Other2848https://iptv-org.github.io/iptv/categories/other.m3u \ No newline at end of file diff --git a/.readme/_countries.md b/.readme/_countries.md index b93a15a32..757b92e34 100644 --- a/.readme/_countries.md +++ b/.readme/_countries.md @@ -38,7 +38,7 @@ ๐Ÿ‡ง๐Ÿ‡ฎ Burundi3https://iptv-org.github.io/iptv/countries/bi.m3u ๐Ÿ‡ฐ๐Ÿ‡ญ Cambodia12https://iptv-org.github.io/iptv/countries/kh.m3u ๐Ÿ‡จ๐Ÿ‡ฒ Cameroon8https://iptv-org.github.io/iptv/countries/cm.m3u - ๐Ÿ‡จ๐Ÿ‡ฆ Canada41https://iptv-org.github.io/iptv/countries/ca.m3u + ๐Ÿ‡จ๐Ÿ‡ฆ Canada45https://iptv-org.github.io/iptv/countries/ca.m3u ๐Ÿ‡จ๐Ÿ‡ป Cape Verde3https://iptv-org.github.io/iptv/countries/cv.m3u ๐Ÿ‡ฐ๐Ÿ‡พ Cayman Islands1https://iptv-org.github.io/iptv/countries/ky.m3u ๐Ÿ‡จ๐Ÿ‡ซ Central African Republic3https://iptv-org.github.io/iptv/countries/cf.m3u diff --git a/.readme/_languages.md b/.readme/_languages.md index 205a5eb32..213b36108 100644 --- a/.readme/_languages.md +++ b/.readme/_languages.md @@ -20,7 +20,7 @@ Czech19https://iptv-org.github.io/iptv/languages/ces.m3u Danish12https://iptv-org.github.io/iptv/languages/dan.m3u Dutch67https://iptv-org.github.io/iptv/languages/nld.m3u - English735https://iptv-org.github.io/iptv/languages/eng.m3u + English739https://iptv-org.github.io/iptv/languages/eng.m3u Estonian3https://iptv-org.github.io/iptv/languages/est.m3u Faroese1https://iptv-org.github.io/iptv/languages/fao.m3u Finnish3https://iptv-org.github.io/iptv/languages/fin.m3u diff --git a/README.md b/README.md index 1a3c2636b..be607a60a 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Or select one of the playlists from the list below. Travel8https://iptv-org.github.io/iptv/categories/travel.m3u Weather4https://iptv-org.github.io/iptv/categories/weather.m3u XXX70https://iptv-org.github.io/iptv/categories/xxx.m3u - Other2844https://iptv-org.github.io/iptv/categories/other.m3u + Other2848https://iptv-org.github.io/iptv/categories/other.m3u @@ -84,7 +84,7 @@ Or select one of the playlists from the list below. Czech19https://iptv-org.github.io/iptv/languages/ces.m3u Danish12https://iptv-org.github.io/iptv/languages/dan.m3u Dutch67https://iptv-org.github.io/iptv/languages/nld.m3u - English735https://iptv-org.github.io/iptv/languages/eng.m3u + English739https://iptv-org.github.io/iptv/languages/eng.m3u Estonian3https://iptv-org.github.io/iptv/languages/est.m3u Faroese1https://iptv-org.github.io/iptv/languages/fao.m3u Finnish3https://iptv-org.github.io/iptv/languages/fin.m3u @@ -194,7 +194,7 @@ Or select one of the playlists from the list below. ๐Ÿ‡ง๐Ÿ‡ฎ Burundi3https://iptv-org.github.io/iptv/countries/bi.m3u ๐Ÿ‡ฐ๐Ÿ‡ญ Cambodia12https://iptv-org.github.io/iptv/countries/kh.m3u ๐Ÿ‡จ๐Ÿ‡ฒ Cameroon8https://iptv-org.github.io/iptv/countries/cm.m3u - ๐Ÿ‡จ๐Ÿ‡ฆ Canada41https://iptv-org.github.io/iptv/countries/ca.m3u + ๐Ÿ‡จ๐Ÿ‡ฆ Canada45https://iptv-org.github.io/iptv/countries/ca.m3u ๐Ÿ‡จ๐Ÿ‡ป Cape Verde3https://iptv-org.github.io/iptv/countries/cv.m3u ๐Ÿ‡ฐ๐Ÿ‡พ Cayman Islands1https://iptv-org.github.io/iptv/countries/ky.m3u ๐Ÿ‡จ๐Ÿ‡ซ Central African Republic3https://iptv-org.github.io/iptv/countries/cf.m3u diff --git a/channels/ca.m3u b/channels/ca.m3u index 90c57d4ab..5bedb6aa3 100644 --- a/channels/ca.m3u +++ b/channels/ca.m3u @@ -17,8 +17,14 @@ http://142.112.39.133:8080/catv.mp4 https://hls.savoir.media/live/stream.m3u8 #EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="English" tvg-logo="" group-title="News",CBC News Network https://cbcnewshd-f.akamaihd.net/i/cbcnews_30@304030/index_2500_av-p.m3u8 +#EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="English" tvg-logo="" group-title="",CBC Toronto +https://bozztv.com/teleyupp1/teleup-ydcl2V1MVC/playlist.m3u8 +#EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="English" tvg-logo="" group-title="",CityTV Toronto +https://bozztv.com/teleyupp1/teleup-iSykLSKMFr/playlist.m3u8 #EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="French" tvg-logo="https://i.imgur.com/wwmapsS.png" group-title="Legislative",CPAC (720p) https://bcsecurelivehls-i.akamaihd.net/hls/live/680604/1242843915001_3/master.m3u8 +#EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="English" tvg-logo="" group-title="",CTV Toronto +https://bozztv.com/teleyupp1/teleup-zxsJFt6VvY/playlist.m3u8 #EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="Urdu" tvg-logo="" group-title="",Eawaz TV (720p) https://streamer12.vdn.dstreamone.net/saazoawaz/saazoawaz/playlist.m3u8 #EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="French" tvg-logo="https://i.imgur.com/HRqcIcR.png" group-title="",EMCI TV (1080p) @@ -75,17 +81,11 @@ http://toronto3.live247stream.com/toronto360/tv/playlist.m3u8 https://tscstreaming-lh.akamaihd.net/i/TSCLiveStreaming_1@91031/master.m3u8 #EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="English" tvg-logo="https://i.imgur.com/brxkNbw.png" group-title="Local",TV 16 Toronto (720p) http://capcobroadcaststream.in:1935/capco/tv29/playlist.m3u8 +#EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="English" tvg-logo="" group-title="",TVO +https://bozztv.com/teleyupp1/teleup-OMZsmYVUMp/playlist.m3u8 #EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="French" tvg-logo="https://i.imgur.com/oRigj9q.jpg" group-title="",Tรฉlรฉ Culturelle Mรฉdias (720p) https://5790d294af2dc.streamlock.net/8150/8150/playlist.m3u8 #EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="Urdu" tvg-logo="https://i.imgur.com/7768lwn.jpg" group-title="Local",Urdu TV Toronto (720p) http://cdn4.live247stream.com/urdu/tv/playlist.m3u8 #EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="Vietnamese" tvg-logo="https://i.imgur.com/IWpevBp.jpg" group-title="",VBS https://uni6rtmp.tulix.tv/vbstv/vbsabr.smil/playlist.m3u8 -#EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="English" tvg-logo="" group-title="",CBC Toronto -https://bozztv.com/teleyupp1/teleup-ydcl2V1MVC/playlist.m3u8 -#EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="English" tvg-logo="" group-title="",CTV Toronto -https://bozztv.com/teleyupp1/teleup-zxsJFt6VvY/playlist.m3u8 -#EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="English" tvg-logo="" group-title="",TVO -https://bozztv.com/teleyupp1/teleup-OMZsmYVUMp/playlist.m3u8 -#EXTINF:-1 tvg-id="" tvg-name="" tvg-country="CA" tvg-language="English" tvg-logo="" group-title="",CityTV Toronto -https://bozztv.com/teleyupp1/teleup-iSykLSKMFr/playlist.m3u8 diff --git a/channels/iq.m3u b/channels/iq.m3u index 4a76fbad8..09eff5bc3 100644 --- a/channels/iq.m3u +++ b/channels/iq.m3u @@ -26,7 +26,7 @@ http://82.212.74.100:8000/live/hls/8951.m3u8 #EXTINF:-1 tvg-id="" tvg-name="" tvg-country="IQ" tvg-language="Arabic" tvg-logo="https://i.imgur.com/way7KwN.jpg" group-title="General",Assyrian ANB (720p) https://597f64b67707a.streamlock.net/anbsat.com/anb2/playlist.m3u8 #EXTINF:-1 tvg-id="" tvg-name="" tvg-country="IQ" tvg-language="Arabic" tvg-logo="https://babylontv.net/wp-content/themes/babylontv/images/logo.png" group-title="General",Babylon TV -https://iqlivestream.com/babylontv/babylonlivestream.m3u8 +https://iqlivestream.com/live/babylontv.flv #EXTINF:-1 tvg-id="" tvg-name="" tvg-country="IQ" tvg-language="Arabic" tvg-logo="https://www.dijlah.tv/templates/default-2/live-page/images/logo-new1.png" group-title="News",Dijlah http://91.134.145.75:10001/Dijlah/tracks-v1a1/mono.m3u8 #EXTINF:-1 tvg-id="" tvg-name="" tvg-country="IQ" tvg-language="Arabic" tvg-logo="https://www.dijlah.tv/templates/default-2/live-page/images/logo-new1.png" group-title="News",Dijlah (576p) diff --git a/scripts/db.js b/scripts/db.js index 77ad2eda3..91795217e 100644 --- a/scripts/db.js +++ b/scripts/db.js @@ -8,6 +8,7 @@ db.load = function () { const items = parser.parseIndex() for (const item of items) { const playlist = parser.parsePlaylist(item.url) + db.playlists.add(playlist) for (const channel of playlist.channels) { db.channels.add(channel) @@ -166,4 +167,28 @@ db.categories = { } } +db.playlists = { + list: [], + add(playlist) { + this.list.push(playlist) + }, + all() { + return this.list + }, + only(list = []) { + return this.list.filter(playlist => list.includes(playlist.name)) + }, + except(list = []) { + return this.list.filter(playlist => !list.includes(playlist.name)) + }, + sortBy(fields) { + this.list = utils.sortBy(this.list, fields) + + return this + }, + count() { + return this.list.length + } +} + module.exports = db diff --git a/scripts/generate.js b/scripts/generate.js index 6c6a0af26..369483ecd 100644 --- a/scripts/generate.js +++ b/scripts/generate.js @@ -67,20 +67,19 @@ function generateCountryIndex() { const filename = `${ROOT_DIR}/index.country.m3u` utils.createFile(filename, '#EXTM3U\n') - const channels = db.channels.sortBy(['name', 'url']).forCountry({ code: null }).get() - for (const channel of channels) { + const unsorted = db.playlists.only(['unsorted'])[0] + for (const channel of unsorted.channels) { const category = channel.category channel.category = '' utils.appendToFile(filename, channel.toString()) channel.category = category } - const countries = db.countries.sortBy(['name']).all() - for (const country of countries) { - const channels = db.channels.sortBy(['name', 'url']).forCountry(country).get() - for (const channel of channels) { + const playlists = db.playlists.sortBy(['country']).except(['unsorted']) + for (const playlist of playlists) { + for (const channel of playlist.channels) { const category = channel.category - channel.category = country.name + channel.category = playlist.country utils.appendToFile(filename, channel.toString()) channel.category = category } diff --git a/scripts/parser.js b/scripts/parser.js index ca43d90c4..9af768677 100644 --- a/scripts/parser.js +++ b/scripts/parser.js @@ -2,6 +2,7 @@ const playlistParser = require('iptv-playlist-parser') const epgParser = require('epg-parser') const utils = require('./utils') const categories = require('./categories') +const path = require('path'); const parser = {} @@ -15,8 +16,10 @@ parser.parseIndex = function () { parser.parsePlaylist = function (filename) { const content = utils.readFile(filename) const result = playlistParser.parse(content) + const name = path.parse(filename).name + const country = utils.code2name(name) - return new Playlist({ header: result.header, items: result.items, url: filename }) + return new Playlist({ header: result.header, items: result.items, url: filename, country, name }) } parser.parseEPG = async function (url) { @@ -32,8 +35,10 @@ parser.parseEPG = async function (url) { } class Playlist { - constructor({ header, items, url }) { + constructor({ header, items, url, name, country }) { this.url = url + this.name = name + this.country = country this.header = header this.channels = items .map(item => new Channel({ data: item, header, sourceUrl: url }))