MCPcopy Create free account
hub / github.com/ClydeTime/Surge / getVersion

Function getVersion

Script/Task/videoqq.js:565–590  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

563}
564
565async function getVersion() {
566 const timeoutMs = 10000;
567 const opt = {
568 url: "https://github.wowyijiu.today/https://raw.githubusercontent.com/WowYiJiu/Personal/main/Script/tenvideo.js",
569 timeout: timeoutMs
570 };
571 let data = await $.fetch(opt).then(response => {
572 try {
573 if (response) {
574 return response
575 }else {
576 return "undefined"
577 }
578 } catch (e) {
579 $.logErr(e, response)
580 }
581 })
582 data = $.toStr(data)
583 const versionInfo = data.match(/@version\s+(v\d+\.\d+\.\d+)/);
584 if (versionInfo) {
585 latestVersion = versionInfo[1];
586 } else {
587 latestVersion = "undefined";
588 }
589 return latestVersion;
590}
591
592async function SendMsg() {
593 $.msg($.name, "", `${$.version}\n${$.taskInfo}`);

Callers 1

videoqq.jsFile · 0.85

Calls 3

fetchMethod · 0.45
logErrMethod · 0.45
toStrMethod · 0.45

Tested by

no test coverage detected