()
| 121 | } |
| 122 | } |
| 123 | async 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 | |
| 152 | async function changeFile (content) { |
| 153 | console.log(`开始替换变量`) |
nothing calls this directly
no test coverage detected