判断location非空

This commit is contained in:
test
2025-12-03 21:04:01 +08:00
parent 554379bbd0
commit d72691f6a4
2 changed files with 10 additions and 1 deletions

6
app.js
View File

@@ -196,6 +196,10 @@ const server = http.createServer(async (req, res) => {
})
const location = obj.headers.get("Location")
if (location == "" || location == undefined || location == null) {
continue
}
if (location.startsWith("http://hlsz")) {
resObj.url = location
break
@@ -279,7 +283,7 @@ server.listen(port, async () => {
try {
// 初始化数据
await update(hours)
// await update(hours)
} catch (error) {
printRed("更新失败")
console.log(error)

View File

@@ -53,6 +53,11 @@ async function fetchURLByAndroid720p() {
})
const location = obj.headers.get("Location")
if (location == "" || location == undefined || location == null) {
continue
}
if (location.startsWith("http://hlsz")) {
resObj.url = location
break