mirror of
https://github.com/iptv-org/iptv
synced 2025-12-17 10:57:18 -05:00
Update update-database.js
This commit is contained in:
@@ -86,7 +86,7 @@ async function updateStreams() {
|
|||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
const { error, streams, requests } = result
|
const { error, streams, requests } = result
|
||||||
const status = parseStatus(error)
|
const status = parseStatus(error, item.status)
|
||||||
const resolution = parseResolution(streams)
|
const resolution = parseResolution(streams)
|
||||||
const origin = findOrigin(requests)
|
const origin = findOrigin(requests)
|
||||||
|
|
||||||
@@ -200,17 +200,19 @@ function parseResolution(streams) {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseStatus(error) {
|
function parseStatus(error, prevStatus) {
|
||||||
if (error) {
|
if (error) {
|
||||||
if (error.includes('timed out')) {
|
if (error.includes('timed out')) {
|
||||||
return statuses['timeout']
|
return statuses['timeout']
|
||||||
} else if (error.includes('403')) {
|
} else if (error.includes('403')) {
|
||||||
return statuses['geo_blocked']
|
return statuses['geo_blocked']
|
||||||
|
} else if (['not_247', 'geo_blocked'].includes(prevStatus.code)) {
|
||||||
|
return prevStatus
|
||||||
}
|
}
|
||||||
return statuses['offline']
|
return statuses['offline']
|
||||||
}
|
}
|
||||||
|
|
||||||
return null
|
return statuses['online']
|
||||||
}
|
}
|
||||||
|
|
||||||
function findLogo(id) {
|
function findLogo(id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user