mirror of
https://github.com/iptv-org/iptv
synced 2026-05-06 09:37:11 -04:00
Delete database/cleanup.js
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
{"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":null,"user_agent":null,"status":"online","cluster_id":1,"_id":"2ST8btby3mmsgPF0"}
|
||||
{"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,"status":"online","cluster_id":1,"_id":"I6cjG2xCBRFFP4sz"}
|
||||
{"title":"BBC News HD","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,"status":"online","cluster_id":3,"_id":"WTbieV1ptnZVCIdn"}
|
||||
{"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,"status":"blocked","cluster_id":1,"_id":"cFFpFVzSn6xFMUF3"}
|
||||
{"title":"Sharq","channel":"Sharq.af","filepath":"channels/af.m3u","url":"http://51.210.199.50/hls/stream.m3u8","http_referrer":null,"user_agent":null,"status":"timeout","cluster_id":1,"_id":"u7iyA6cjtf1iWWAZ"}
|
||||
@@ -1,6 +0,0 @@
|
||||
{"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":null,"user_agent":null,"status":"online","cluster_id":1,"_id":"2ST8btby3mmsgPF0"}
|
||||
{"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,"status":"error","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,"status":"online","cluster_id":1,"_id":"I6cjG2xCBRFFP4sz"}
|
||||
{"title":"BBC News HD","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,"status":"online","cluster_id":3,"_id":"WTbieV1ptnZVCIdn"}
|
||||
{"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,"status":"blocked","cluster_id":1,"_id":"cFFpFVzSn6xFMUF3"}
|
||||
{"title":"Sharq","channel":"Sharq.af","filepath":"channels/af.m3u","url":"http://51.210.199.50/hls/stream.m3u8","http_referrer":null,"user_agent":null,"status":"timeout","cluster_id":1,"_id":"u7iyA6cjtf1iWWAZ"}
|
||||
@@ -1,34 +0,0 @@
|
||||
const { execSync } = require('child_process')
|
||||
const fs = require('fs-extra')
|
||||
const path = require('path')
|
||||
|
||||
beforeEach(() => {
|
||||
fs.emptyDirSync('tests/__data__/output')
|
||||
fs.copyFileSync(
|
||||
'tests/__data__/input/database/db_cleanup.streams.db',
|
||||
'tests/__data__/output/streams.db'
|
||||
)
|
||||
|
||||
const stdout = execSync('DB_DIR=tests/__data__/output npm run db:cleanup', {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
})
|
||||
|
||||
it('can remove broken links from database', () => {
|
||||
expect(content('tests/__data__/output/streams.db')).toEqual(
|
||||
content('tests/__data__/expected/database/db_cleanup.streams.db')
|
||||
)
|
||||
})
|
||||
|
||||
function content(filepath) {
|
||||
const data = fs.readFileSync(path.resolve(filepath), {
|
||||
encoding: 'utf8'
|
||||
})
|
||||
|
||||
return data
|
||||
.split('\n')
|
||||
.filter(l => l)
|
||||
.map(l => {
|
||||
return JSON.parse(l)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user