
Code AardioLine:32复制
1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.import
console; import
fsys;import
godking.http;var
url = "https://pc-package.wpscdn.cn/wps/download/W.P.S.60.1955.exe"
;var
startinfo = {};var
data,header,result = godking.http({- url = url;
- file =
"C:\Users\Administrator\Desktop\W.P.S.60.1955.exe"
; - packageSize =
1024
*1024
; - callback =
function
(callbackID,已下载大小,总大小,网址,本地文件名){ -
if
!startinfo.time
{ - startinfo.
time
= time
.tick(); - startinfo.size = 已下载大小;
- }
-
if
已下载大小===-1
and
总大小===-1
console.log("下载完毕!"
); -
else
{ -
var
time
= (time
.tick()-startinfo.time
)/1000
; -
var
size = 已下载大小-startinfo.size; -
if
time
>0
{ - console.dump(
"下载时间:"
++ time
++ "秒"
); - console.dump(
"下载大小:"
++ fsys.formatSize(size)); - console.dump(
"下载速度:"
++ fsys.formatSize(math
.round(size/time
,0
)) ++ "/秒"
); - }
- console.dump(
"下载进度:"
++ math
.round(已下载大小*100
/总大小,2
) ++ "%"
,'\n'
); - }
- }
- })
if
(result.success) {- console.logPause(
"文件已下载完成,请自行验证文件完整性!"
); - }
else
{ - console.logPause(
"下载错误:"
++result.info); - }