Update database/export.js

This commit is contained in:
Aleksandr Statciuk 2022-02-13 05:42:39 +03:00
parent 4d72198955
commit 8f6095d2df
4 changed files with 16 additions and 6 deletions

View File

@ -9,11 +9,15 @@ async function main() {
streams = _.sortBy(streams, 'channel_id') streams = _.sortBy(streams, 'channel_id')
streams = streams.map(stream => { streams = streams.map(stream => {
return { return {
channel: stream.channel_id, channel: stream.channel,
display_name: stream.display_name, title: stream.title,
url: stream.url, url: stream.url,
http_referrer: stream.http['referrer'], width: stream.width,
user_agent: stream.http['user-agent'] height: stream.height,
bitrate: stream.bitrate,
is_online: stream.is_online,
http_referrer: stream.http_referrer,
user_agent: stream.user_agent
} }
}) })

View File

@ -1 +1 @@
[{"channel":"AndorraTV.ad","display_name":"ATV (720p) [Offline]","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":"","user_agent":""},{"channel":"AndorraTV.ad","display_name":"Andorra TV (720p) [Not 24/7]","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","http_referrer":"","user_agent":""},{"channel":"BBCNews.uk","display_name":"BBC News HD (720p) [Not 24/7]","url":"https://query-streamlink.herokuapp.com/iptv-query?streaming-ip=https://www.twitch.tv/absliveantigua3/","http_referrer":"","user_agent":""},{"channel":"LDPRTV.ru","display_name":"ЛДПР ТВ (1080p)","url":"http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8","http_referrer":"","user_agent":""}] [{"channel":"LDPRTV.ru","title":"ЛДПР ТВ","url":"http://46.46.143.222:1935/live/mp4:ldpr.stream/playlist.m3u8","is_online":false,"http_referrer":"","user_agent":""},{"channel":"BBCNews.uk","title":"BBC News HD","url":"http://1111296894.rsc.cdn77.org/LS-ATL-54548-6/index.m3u8","is_online":true,"http_referrer":"","user_agent":""},{"channel":"AndorraTV.ad","title":"ATV","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","is_online":false,"http_referrer":"","user_agent":""},{"channel":"BBCNewsHD.ad","title":"BBC News HD","url":"https://master.starmena-cloud.com/hls/libyas.m3u8","width":1024,"height":576,"bitrate":0,"is_online":true,"http_referrer":"","user_agent":""},{"channel":"KayhanTV.af","title":"Kayhan TV","url":"http://208.93.117.113/live/Stream1/playlist.m3u8","is_online":false,"http_referrer":"","user_agent":""},{"channel":"Sharq.af","title":"Sharq","url":"https://forerunnerrtmp.livestreamingcdn.com/output18/output18.stream/playlist.m3u8","width":1280,"height":720,"bitrate":2226543,"is_online":true,"http_referrer":"","user_agent":""}]

View File

@ -0,0 +1,6 @@
{"title":"ЛДПР ТВ","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":"","user_agent":"","cluster_id":1,"_id":"2ST8btby3mmsgPF0","is_online":false}
{"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":"","user_agent":"","cluster_id":3,"_id":"3TbieV1ptnZVCIdn","is_online":true}
{"title":"ATV","channel":"AndorraTV.ad","filepath":"tests/__data__/output/channels/ad.m3u","url":"https://iptv-all.lanesh4d0w.repl.co/andorra/atv","http_referrer":"","user_agent":"","cluster_id":1,"_id":"I6cjG2xCBRFFP4sz","is_online":false}
{"title":"BBC News HD","channel":"BBCNewsHD.ad","filepath":"tests/__data__/output/channels/uk.m3u","url":"https://master.starmena-cloud.com/hls/libyas.m3u8","http_referrer":"","user_agent":"","cluster_id":3,"_id":"WTbieV1ptnZVCIdn","is_online":true,"bitrate":0,"width":1024,"height":576}
{"title":"Kayhan TV","channel":"KayhanTV.af","filepath":"channels/af.m3u","url":"http://208.93.117.113/live/Stream1/playlist.m3u8","http_referrer":"","user_agent":"","cluster_id":1,"_id":"cFFpFVzSn6xFMUF3","is_online":false}
{"title":"Sharq","channel":"Sharq.af","filepath":"channels/af.m3u","bitrate":2226543,"width":1280,"height":720,"url":"https://forerunnerrtmp.livestreamingcdn.com/output18/output18.stream/playlist.m3u8","http_referrer":"","user_agent":"","cluster_id":1,"_id":"u7iyA6cjtf1iWWAZ","is_online":true}

View File

@ -4,7 +4,7 @@ const fs = require('fs-extra')
beforeEach(() => { beforeEach(() => {
fs.emptyDirSync('tests/__data__/output') fs.emptyDirSync('tests/__data__/output')
fs.copyFileSync( fs.copyFileSync(
'tests/__data__/input/database/base_streams.db', 'tests/__data__/input/database/db_export.streams.db',
'tests/__data__/output/streams.db' 'tests/__data__/output/streams.db'
) )