MCPcopy Create free account
hub / github.com/Semporia/Scripts / downFile

Function downFile

jd_bean_sign.js:123–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

121 }
122}
123async function downFile () {
124 let url = '';
125 await downloadUrl();
126 if ($.body) {
127 url = 'https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js';
128 } else {
129 url = 'https://cdn.jsdelivr.net/gh/NobyDa/Script@master/JD-DailyBonus/JD_DailyBonus.js';
130 }
131 try {
132 const options = { }
133 if (process.env.TG_PROXY_HOST && process.env.TG_PROXY_PORT) {
134 const tunnel = require("tunnel");
135 const agent = {
136 https: tunnel.httpsOverHttp({
137 proxy: {
138 host: process.env.TG_PROXY_HOST,
139 port: process.env.TG_PROXY_PORT * 1
140 }
141 })
142 }
143 Object.assign(options, { agent })
144 }
145 await download(url, outPutUrl, options);
146 console.log(`JD_DailyBonus.js文件下载完毕\n\n`);
147 } catch (e) {
148 console.log("JD_DailyBonus.js 文件下载异常:" + e);
149 }
150}
151
152async function changeFile (content) {
153 console.log(`开始替换变量`)

Callers

nothing calls this directly

Calls 2

downloadUrlFunction · 0.85
logMethod · 0.45

Tested by

no test coverage detected