diff --git a/scripts/commands/database/update.js b/scripts/commands/database/update.js index da1f616b03..20925fad84 100644 --- a/scripts/commands/database/update.js +++ b/scripts/commands/database/update.js @@ -49,11 +49,13 @@ async function updateStreams(items = [], results = {}, origins = {}) { if (buffer[stream.get('url')]) { await db.streams.remove({ _id: stream.get('_id') }) removed++ - } else if (stream.changed) { - stream.set('updated_at', { updated_at: now }) - await db.streams.update({ _id: stream.get('_id') }, stream.data()) + } else { buffer[stream.get('url')] = true - updated++ + if (stream.changed) { + stream.set('updated_at', { updated_at: now }) + await db.streams.update({ _id: stream.get('_id') }, stream.data()) + updated++ + } } } diff --git a/tests/__data__/expected/_readme.md b/tests/__data__/expected/_readme.md index 8d05f0c11f..b553a47d23 100644 --- a/tests/__data__/expected/_readme.md +++ b/tests/__data__/expected/_readme.md @@ -4,25 +4,57 @@ Collection of publicly available IPTV (Internet Protocol television) channels from all over the world. -## Usage +## Table of contents + +- 🚀 [How to use?](#how-to-use) +- 📺 [Playlists](#playlists) +- 🗓 [EPG](#epg) +- 🗄 [Database](#database) +- 👨‍💻 [API](#api) +- 📚 [Resources](#resources) +- 💬 [Discussions](#discussions) +- 🛠 [Contribution](#contribution) +- ⚖ [Legal](#legal) +- © [License](#license) + +## How to use? + +Simply insert one of the links below into [any video player](https://github.com/iptv-org/awesome-iptv#apps) that supports live streaming and press _Open_. ![VLC Network Panel](https://github.com/iptv-org/iptv/raw/master/.readme/preview.png) -To watch IPTV, simply insert one of the links below into any player that supports M3U playlists: +## Playlists -- `https://iptv-org.github.io/iptv/index.m3u` -- `https://iptv-org.github.io/iptv/index.nsfw.m3u` (includes adult channels) -- `https://iptv-org.github.io/iptv/index.category.m3u` (grouped by category) -- `https://iptv-org.github.io/iptv/index.country.m3u` (grouped by country) -- `https://iptv-org.github.io/iptv/index.language.m3u` (grouped by language) -- `https://iptv-org.github.io/iptv/index.region.m3u` (grouped by region) +There are several versions of playlists that differ in the way they are grouped. -### Playlists by category +### Main playlist + +Playlist includes all known channels except adult channels. + +``` +https://iptv-org.github.io/iptv/index.m3u +``` + +And here is the full version: + +``` +https://iptv-org.github.io/iptv/index.nsfw.m3u +``` + +### Grouped by category
Expand
+Playlist in which each channel has its _category_ as a group title: + +``` +https://iptv-org.github.io/iptv/index.category.m3u +``` + +Same thing, but split up into separate files: + @@ -63,12 +95,20 @@ To watch IPTV, simply insert one of the links below into any player that support -### Playlists by language +### Grouped by language
Expand
+Playlist in which each channel has its _language_ as a group title: + +``` +https://iptv-org.github.io/iptv/index.language.m3u +``` + +Same thing, but split up into separate files: +
@@ -85,12 +125,20 @@ To watch IPTV, simply insert one of the links below into any player that support -### Playlists by country +### Grouped by country
Expand
+Playlist in which each channel has its _country_ as a group title: + +``` +https://iptv-org.github.io/iptv/index.country.m3u +``` + +Same thing, but split up into separate files: +
@@ -353,12 +401,20 @@ To watch IPTV, simply insert one of the links below into any player that support -### Playlists by region +### Grouped by region
Expand
+Playlist in which each channel has its _region_ as a group title: + +``` +https://iptv-org.github.io/iptv/index.region.m3u +``` + +Same thing, but split up into separate files: +
@@ -411,10 +467,24 @@ The API documentation can be found in the [iptv-org/api](https://github.com/iptv Links to other useful IPTV-related resources can be found in the [iptv-org/awesome-iptv](https://github.com/iptv-org/awesome-iptv) repository. +## Discussions + +If you have a question or an idea, you can post it in the [Discussions](https://github.com/iptv-org/iptv/discussions) tab. + ## Contribution Please make sure to read the [Contributing Guide](CONTRIBUTING.md) before sending an issue or making a pull request. +And thank you to everyone who has already contributed! + +### Backers + + + +### Contributors + + + ## Legal No video files are stored in this repository. The repository simply contains user-submitted links to publicly available video stream URLs, which to the best of our knowledge have been intentionally made publicly by the copyright holders. If any links in these playlists infringe on your rights as a copyright holder, they may be removed by sending a [pull request](https://github.com/iptv-org/iptv/pulls) or opening an [issue](https://github.com/iptv-org/iptv/issues/new?assignees=freearhey&labels=removal+request&template=--removal-request.yml&title=Remove%3A+). However, note that we have **no control** over the destination of the link, and just removing the link from the playlist will not remove its contents from the web. Note that linking does not directly infringe copyright because no copy is made on the site providing the link, and thus this is **not** a valid reason to send a DMCA notice to GitHub. To remove this content from the web, you should contact the web host that's actually hosting the content (**not** GitHub, nor the maintainers of this repository). diff --git a/tests/__data__/expected/database/db_clear.streams.db b/tests/__data__/expected/database/db_clear.streams.db index 7b23321d03..842173f082 100644 --- a/tests/__data__/expected/database/db_clear.streams.db +++ b/tests/__data__/expected/database/db_clear.streams.db @@ -1,4 +1,3 @@ -{"title":"ЛДПР ТВ","channel":"LDPRTV.ru","filepath":"tests/__data__/output/streams/ru.m3u","url":"http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"2ST8btby3mmsgPF0","status":"error"} {"title":"BBC News HD","channel":"BBCNews.uk","filepath":"tests/__data__/output/streams/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","http_referrer":null,"user_agent":null,"cluster_id":3,"_id":"3TbieV1ptnZVCIdn","status":"blocked"} {"title":"BBC News HD","channel":"BBCNewsHD.uk","filepath":"tests/__data__/output/streams/uk.m3u","url":"https://master.starmena-cloud.com/hls/bbc.m3u8","http_referrer":null,"user_agent":null,"cluster_id":3,"_id":"WTbieV1ptnXVCIdn","status":"online","bitrate":0,"frame_rate":25,"width":1024,"height":576} {"title":"Libyas Channel","channel":"LibyasChannel.ly","filepath":"tests/__data__/output/streams/ly.m3u","url":"https://master.starmena-cloud.com/hls/libyas.m3u8","http_referrer":null,"user_agent":null,"cluster_id":3,"_id":"WTbieV1ptnZVCIdn","status":"online","bitrate":0,"frame_rate":25,"width":1024,"height":576} diff --git a/tests/__data__/expected/database/db_update.streams.db b/tests/__data__/expected/database/db_update.streams.db index 7ab6aa1f74..7db77930a3 100644 --- a/tests/__data__/expected/database/db_update.streams.db +++ b/tests/__data__/expected/database/db_update.streams.db @@ -2,6 +2,7 @@ {"title":"BBC News HD","channel":"BBCNews.uk","filepath":"tests/__data__/output/streams/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","http_referrer":null,"user_agent":null,"cluster_id":3,"_id":"3TbieV1ptnZVCIdn","status":"blocked"} {"title":"ATV","channel":"AndorraTV.ad","filepath":"tests/__data__/output/streams/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"I6cjG2xCBRFFP4sz","status":"error"} {"title":"BBC News HD","channel":"BBCNewsHD.ad","filepath":"tests/__data__/output/streams/uk.m3u","url":"https://master.starmena-cloud.com/hls/libyas.m3u8","http_referrer":null,"user_agent":null,"cluster_id":3,"_id":"WTbieV1ptnZVCIdn","status":"online","bitrate":0,"frame_rate":29.97,"width":1024,"height":576} +{"title":"辽源新闻综合 [Geo-blocked]","channel":null,"filepath":"channels/cn.m3u","url":"http://stream2.jlntv.cn/liaoyuan1/sd/live.m3u8","http_referrer":null,"user_agent":null,"cluster_id":4,"_id":"a7iyA6cjtf1iWWAZ"} {"title":"Tele 2000","channel":"Tele2000.pe","filepath":"tests/__data__/output/streams/pe.m3u","url":"https://servilive.com:3126/live/tele2000live.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"cF0pFVzSn6xFMUF3"} {"title":"Kayhan TV","channel":"KayhanTV.af","filepath":"channels/af.m3u","url":"http://208.93.117.113/live/Stream1/playlist.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"cFFpFVzSn6xFMUF3","status":"error"} -{"title":"Sharq","channel":"Sharq.af","filepath":"channels/af.m3u","bitrate":2226543,"frame_rate":25,"width":1280,"height":720,"url":"https://forerunnerrtmp.livestreamingcdn.com/output18/output18.stream/playlist.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"u7iyA6cjtf1iWWAZ","status":"online"} +{"title":"Sharq","channel":"Sharq.af","filepath":"channels/af.m3u","bitrate":2226543,"frame_rate":25,"width":1280,"height":720,"url":"https://forerunnerrtmp.livestreamingcdn.com/output18/output18.stream/playlist.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"u7iyA6cjtf1iWWAZ","status":"online"} \ No newline at end of file diff --git a/tests/__data__/input/database/db_update.streams.db b/tests/__data__/input/database/db_update.streams.db index 70ab1888c7..dcf203c878 100644 --- a/tests/__data__/input/database/db_update.streams.db +++ b/tests/__data__/input/database/db_update.streams.db @@ -6,3 +6,5 @@ {"title":"BBC News HD","channel":"BBCNewsHD.ad","filepath":"tests/__data__/output/streams/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","http_referrer":null,"user_agent":null,"cluster_id":3,"_id":"WTbieV1ptnZVCIdn"} {"title":"ABC","channel":"ABC.uk","filepath":"tests/__data__/output/streams/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","http_referrer":null,"user_agent":null,"cluster_id":3,"_id":"WTbieV1ptnZVCI3n"} {"title":"Tele 2000","channel":"Tele2000.pe","filepath":"tests/__data__/output/streams/pe.m3u","url":"https://servilive.com:3126/live/tele2000live.m3u8","http_referrer":null,"user_agent":null,"cluster_id":1,"_id":"cF0pFVzSn6xFMUF3"} +{"title":"辽源新闻综合 [Geo-blocked]","channel":null,"filepath":"channels/cn.m3u","url":"http://stream2.jlntv.cn/liaoyuan1/sd/live.m3u8","http_referrer":null,"user_agent":null,"cluster_id":4,"_id":"a7iyA6cjtf1iWWAZ"} +{"title":"辽源新闻综合 [Geo-blocked]","channel":null,"filepath":"channels/cn.m3u","url":"http://stream2.jlntv.cn/liaoyuan1/sd/live.m3u8","http_referrer":null,"user_agent":null,"cluster_id":4,"_id":"b7iyA6cjtf1iWWAZ"} \ No newline at end of file diff --git a/tests/commands/database/update.test.js b/tests/commands/database/update.test.js index abaf4b7a96..6efab127a1 100644 --- a/tests/commands/database/update.test.js +++ b/tests/commands/database/update.test.js @@ -21,14 +21,14 @@ it('can save results', () => { > node scripts/commands/database/update.js loading streams... -found 8 streams +found 10 streams loading check results... found 6 results loading origins... found 2 origins updating streams... updated 6 streams -removed 1 duplicates +removed 2 duplicates done `)