From a0eca2bebeeba77fe2c5143a90ec2df9399d5e3f Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 13 Feb 2022 10:33:44 +0300 Subject: [PATCH] Update playlist/generate.js --- scripts/commands/playlist/generate.js | 2 +- .../database/playlist_generate.streams.db | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/commands/playlist/generate.js b/scripts/commands/playlist/generate.js index cb4e665236..35ef0c4504 100644 --- a/scripts/commands/playlist/generate.js +++ b/scripts/commands/playlist/generate.js @@ -31,7 +31,7 @@ main() async function loadStreams() { await db.streams.load() - let streams = await db.streams.find({ is_online: true }) + let streams = await db.streams.find({ status: { $in: ['online', 'timeout', 'blocked'] } }) streams = orderBy(streams, ['channel', 'height', 'url'], ['asc', 'desc', 'asc']) streams = _.uniqBy(streams, stream => stream.channel || _.uniqueId()) diff --git a/tests/__data__/input/database/playlist_generate.streams.db b/tests/__data__/input/database/playlist_generate.streams.db index 30989b1878..ffb6efaf5a 100644 --- a/tests/__data__/input/database/playlist_generate.streams.db +++ b/tests/__data__/input/database/playlist_generate.streams.db @@ -1,11 +1,11 @@ -{"title":"ЛДПР ТВ (1080p)","channel":"LDPRTV.ru","filepath":"tests/__data__/output/channels/ru.m3u","url":"http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8","http_referrer":null,"user_agent":null,"height":1080,"width":1920,"is_online":true,"cluster_id":1,"_id":"2ST8btby3mmsgPF0"} -{"title":"BBC News HD (720p) [Geo-blocked]","channel":"BBCNews.uk","filepath":"tests/__data__/output/channels/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/playlist.m3u8","http_referrer":null,"user_agent":null,"height":720,"width":1280,"is_online":true,"cluster_id":3,"_id":"3TbieV1ptnZVCId5"} -{"title":"BBC News HD","channel":"BBCNews.uk","filepath":"tests/__data__/output/channels/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","http_referrer":null,"user_agent":null,"height":720,"width":1280,"is_online":true,"cluster_id":3,"_id":"3TbieV1ptnZVCIdn"} -{"title":"ATV","channel":"AndorraTV.ad","filepath":"tests/__data__/output/channels/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":null,"user_agent":null,"is_broken":true,"updated":false,"height":720,"width":1280,"is_online":false,"cluster_id":1,"_id":"I6cjG2xCBRFFP44z"} -{"title":"Andorra TV (720p) [Not 24/7]","channel":"","filepath":"tests/__data__/output/channels/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8","http_referrer":null,"user_agent":null,"height":720,"width":1280,"is_online":true,"cluster_id":3,"_id":"WTbieV1ptnZVCIdn"} -{"title":"Visit-X TV","channel":"VisitXTV.nl","filepath":"tests/__data__/output/channels/nl.m3u","url":"https://stream.visit-x.tv/vxtv/ngrp:live_all/playlist.m3u8","http_referrer":null,"user_agent":null,"is_online":true,"cluster_id":1,"_id":"2ST8btby3mmsgPF5"} -{"title":"Tastemade","channel":"","filepath":"tests/__data__/output/channels/unsorted.m3u","url":"https://tastemade-freetv16min-plex.amagi.tv/hls/amagi_hls_data_tastemade-tastemadefreetv16-plex/CDN/playlist.m3u8","http_referrer":null,"user_agent":null,"is_online":true,"cluster_id":1,"_id":"2ST8btby3mmsgPAB"} -{"title":"Daawah TV","channel":"","filepath":"tests/__data__/output/channels/in.m3u","url":"http://51.15.246.58:8081/daawahtv/daawahtv2/playlist.m3u8","http_referrer":null,"user_agent":null,"is_online":true,"cluster_id":1,"_id":"2ST8btby3mmsgPF9"} -{"title":"Meteomedia","channel":"MeteoMedia.ca","filepath":"tests/__data__/output/channels/in.m3u","url":"http://encodercdn1.frontline.ca/encoder181/output/Meteo_Media_720p/playlist.m3u8","http_referrer":null,"user_agent":null,"is_online":true,"cluster_id":1,"_id":"2ST8btby3mmsgP49"} -{"title":"Zoo (480p)","channel":"Zoo.ad","filepath":"tests/__data__/output/channels/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/zoo?480","http_referrer":null,"user_agent":null,"height":480,"width":640,"is_online":true,"cluster_id":1,"_id":"I6cjG2xCBRFFP4s3"} -{"title":"Zoo (720p)","channel":"Zoo.ad","filepath":"tests/__data__/output/channels/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/zoo","http_referrer":null,"user_agent":null,"height":720,"width":1280,"is_online":true,"cluster_id":1,"_id":"I6cjG2xCBRFFP4sz"} +{"title":"ЛДПР ТВ (1080p)","channel":"LDPRTV.ru","filepath":"tests/__data__/output/channels/ru.m3u","url":"http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8","http_referrer":null,"user_agent":null,"height":1080,"width":1920,"status":"online","cluster_id":1,"_id":"2ST8btby3mmsgPF0"} +{"title":"BBC News HD (720p) [Geo-blocked]","channel":"BBCNews.uk","filepath":"tests/__data__/output/channels/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/playlist.m3u8","http_referrer":null,"user_agent":null,"height":720,"width":1280,"status":"online","cluster_id":3,"_id":"3TbieV1ptnZVCId5"} +{"title":"BBC News HD","channel":"BBCNews.uk","filepath":"tests/__data__/output/channels/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","http_referrer":null,"user_agent":null,"height":720,"width":1280,"status":"online","cluster_id":3,"_id":"3TbieV1ptnZVCIdn"} +{"title":"ATV","channel":"AndorraTV.ad","filepath":"tests/__data__/output/channels/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":null,"user_agent":null,"height":720,"width":1280,"status":"error","cluster_id":1,"_id":"I6cjG2xCBRFFP44z"} +{"title":"Andorra TV (720p) [Not 24/7]","channel":"","filepath":"tests/__data__/output/channels/uk.m3u","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index2.m3u8","http_referrer":null,"user_agent":null,"height":720,"width":1280,"status":"online","cluster_id":3,"_id":"WTbieV1ptnZVCIdn"} +{"title":"Visit-X TV","channel":"VisitXTV.nl","filepath":"tests/__data__/output/channels/nl.m3u","url":"https://stream.visit-x.tv/vxtv/ngrp:live_all/playlist.m3u8","http_referrer":null,"user_agent":null,"status":"online","cluster_id":1,"_id":"2ST8btby3mmsgPF5"} +{"title":"Tastemade","channel":"","filepath":"tests/__data__/output/channels/unsorted.m3u","url":"https://tastemade-freetv16min-plex.amagi.tv/hls/amagi_hls_data_tastemade-tastemadefreetv16-plex/CDN/playlist.m3u8","http_referrer":null,"user_agent":null,"status":"online","cluster_id":1,"_id":"2ST8btby3mmsgPAB"} +{"title":"Daawah TV","channel":"","filepath":"tests/__data__/output/channels/in.m3u","url":"http://51.15.246.58:8081/daawahtv/daawahtv2/playlist.m3u8","http_referrer":null,"user_agent":null,"status":"online","cluster_id":1,"_id":"2ST8btby3mmsgPF9"} +{"title":"Meteomedia","channel":"MeteoMedia.ca","filepath":"tests/__data__/output/channels/in.m3u","url":"http://encodercdn1.frontline.ca/encoder181/output/Meteo_Media_720p/playlist.m3u8","http_referrer":null,"user_agent":null,"status":"online","cluster_id":1,"_id":"2ST8btby3mmsgP49"} +{"title":"Zoo (480p)","channel":"Zoo.ad","filepath":"tests/__data__/output/channels/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/zoo?480","http_referrer":null,"user_agent":null,"height":480,"width":640,"status":"online","cluster_id":1,"_id":"I6cjG2xCBRFFP4s3"} +{"title":"Zoo (720p)","channel":"Zoo.ad","filepath":"tests/__data__/output/channels/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/zoo","http_referrer":null,"user_agent":null,"height":720,"width":1280,"status":"online","cluster_id":1,"_id":"I6cjG2xCBRFFP4sz"}