mirror of
https://github.com/iptv-org/iptv
synced 2026-09-09 13:27:58 -04:00
Merge pull request #50558 from iptv-org/patch-2026.09.1
Patch 2026.09.1
This commit is contained in:
@@ -113,11 +113,12 @@ async function main() {
|
||||
streams = streams.sortBy(
|
||||
[
|
||||
(stream: Stream) => stream.title,
|
||||
(stream: Stream) => (stream.isGeoBlocked ? -1 : 0),
|
||||
(stream: Stream) => (stream.isNot247 ? -1 : 0),
|
||||
(stream: Stream) => stream.getVerticalResolution(),
|
||||
(stream: Stream) => stream.label,
|
||||
(stream: Stream) => stream.url
|
||||
],
|
||||
['asc', 'desc', 'asc', 'asc']
|
||||
['asc', 'desc', 'desc', 'desc', 'asc']
|
||||
)
|
||||
|
||||
logger.info('saving...')
|
||||
|
||||
@@ -48,10 +48,11 @@ async function main() {
|
||||
streams = streams.sortBy(
|
||||
[
|
||||
(stream: Stream) => stream.getId(),
|
||||
(stream: Stream) => stream.getVerticalResolution(),
|
||||
(stream: Stream) => stream.label
|
||||
(stream: Stream) => (stream.isGeoBlocked ? -1 : 0),
|
||||
(stream: Stream) => (stream.isNot247 ? -1 : 0),
|
||||
(stream: Stream) => stream.getVerticalResolution()
|
||||
],
|
||||
['asc', 'desc', 'desc']
|
||||
['asc', 'desc', 'desc', 'desc']
|
||||
)
|
||||
|
||||
logger.info('filtering streams...')
|
||||
|
||||
@@ -109,7 +109,7 @@ async function runTest(stream: Stream) {
|
||||
stream.statusCode = result.status.code
|
||||
|
||||
if (stream.statusCode === 'OK') return
|
||||
if (errorStatusCodes.includes(stream.statusCode) && !stream.label) {
|
||||
if (errorStatusCodes.includes(stream.statusCode) && !stream.getLabels().length) {
|
||||
errors++
|
||||
} else {
|
||||
warnings++
|
||||
@@ -129,7 +129,7 @@ function drawTable() {
|
||||
{ name: '', alignment: 'center', minLen: 3, maxLen: 3 },
|
||||
{ name: 'tvg-id', alignment: 'left', color: 'green', minLen: 25, maxLen: 25 },
|
||||
{ name: 'url', alignment: 'left', color: 'green', minLen: 100, maxLen: 100 },
|
||||
{ name: 'label', alignment: 'left', color: 'yellow', minLen: 13, maxLen: 13 },
|
||||
{ name: 'labels', alignment: 'left', color: 'yellow', minLen: 13, maxLen: 13 },
|
||||
{ name: 'status', alignment: 'left', minLen: 25, maxLen: 25 }
|
||||
]
|
||||
})
|
||||
@@ -138,14 +138,14 @@ function drawTable() {
|
||||
const tvgId = truncate(stream.getTvgId(), 25)
|
||||
const url = truncate(stream.url, 100)
|
||||
const color = getColor(stream)
|
||||
const label = stream.label || ''
|
||||
const labels = stream.getLabels().join(';')
|
||||
const status = stream.statusCode || 'PENDING'
|
||||
|
||||
const row = {
|
||||
'': index,
|
||||
'tvg-id': chalk[color](tvgId),
|
||||
url: chalk[color](url),
|
||||
label: chalk[color](label),
|
||||
labels: chalk[color](labels),
|
||||
status: chalk[color](status)
|
||||
}
|
||||
table.append(row)
|
||||
@@ -206,14 +206,14 @@ function getColor(stream: Stream): string {
|
||||
if (!stream.statusCode) return 'gray'
|
||||
if (stream.statusCode === 'LOADING...') return 'white'
|
||||
if (stream.statusCode === 'OK') return 'green'
|
||||
if (errorStatusCodes.includes(stream.statusCode) && !stream.label) return 'red'
|
||||
if (errorStatusCodes.includes(stream.statusCode) && !stream.getLabels().length) return 'red'
|
||||
|
||||
return 'yellow'
|
||||
}
|
||||
|
||||
function isBroken(stream: Stream): boolean {
|
||||
if (!stream.statusCode) return false
|
||||
if (stream.label) return false
|
||||
if (stream.getLabels().length) return false
|
||||
if (!errorStatusCodes.includes(stream.statusCode)) return false
|
||||
|
||||
return true
|
||||
|
||||
@@ -261,9 +261,15 @@ async function addStream(issue: Issue) {
|
||||
user_agent: httpUserAgent,
|
||||
referrer: httpReferrer,
|
||||
quality,
|
||||
label: data.getString('label') || ''
|
||||
label: null
|
||||
})
|
||||
|
||||
const live247 = data.getBoolean('live_247')
|
||||
const geoBlocked = data.getBoolean('geo_blocked')
|
||||
|
||||
stream.isNot247 = live247 === undefined ? false : !live247
|
||||
stream.isGeoBlocked = geoBlocked === true
|
||||
|
||||
stream.updateTitle().updateFilepath()
|
||||
|
||||
stream.setGuides(apiData.guidesGroupedByStreamId.get(stream.getId()))
|
||||
|
||||
Reference in New Issue
Block a user