mirror of
https://github.com/smallfawn/QLScriptPublic.git
synced 2025-12-17 23:35:02 +08:00
Update qtx.js
This commit is contained in:
38
qtx.js
38
qtx.js
@@ -300,29 +300,27 @@ function httpRequest(options, method) {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
async function notice() {
|
/**
|
||||||
|
* 获取远程通知
|
||||||
|
*/
|
||||||
|
async function getNotice() {
|
||||||
try {
|
try {
|
||||||
let options = {
|
const urls = [
|
||||||
url: `https://ghproxy.com/https://raw.githubusercontent.com/smallfawn/api/main/notice.json`,
|
"https://cdn.jsdelivr.net/gh/smallfawn/Note@main/Notice.json",
|
||||||
headers: {
|
"https://ghproxy.com/https://raw.githubusercontent.com/smallfawn/Note/main/Notice.json",
|
||||||
'User-Agent': ''
|
"https://fastly.jsdelivr.net/gh/smallfawn/Note@main/Notice.json",
|
||||||
},
|
"https://gitee.com/smallfawn/Note/raw/master/Notice.json",
|
||||||
}
|
];
|
||||||
//console.log(options);
|
let notice = null;
|
||||||
let result = await httpRequest(options);
|
for (const url of urls) {
|
||||||
//console.log(result);
|
const options = { url, headers: { "User-Agent": "" }, };
|
||||||
if (result) {
|
const result = await httpRequest(options);
|
||||||
if ('notice' in result) {
|
if (result && "notice" in result) {
|
||||||
DoubleLog(`${result.notice}`);
|
notice = result.notice.replace(/\\n/g, "\n");
|
||||||
} else {
|
break;
|
||||||
options.url = `https://gitee.com/smallfawn/api/raw/master/notice.json`
|
|
||||||
result = await httpRequest(options);
|
|
||||||
if ('notice' in result) {
|
|
||||||
DoubleLog(`${result.notice}`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
if (notice) { $.DoubleLog(notice); }
|
||||||
}
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user