~~~lua|woo print('进度下载测试:') _download('deepin.jpg', 'https://storage.deepin.org/forum/2020123007243212_1609327472.jpg', { cookies = { BIDUPSID = '16626'; PSTM = '1609138339' }, headers = { ['User-Agent'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36' } } or nil, function(current, total)-- 注意下载github压缩文件的时候,服务器没有在头部标明长度,那么total始终为0 print('已下载:', current, '总共:', total) end) print('简便下载文件方式,也可直接下载网页内容到文件') _download('r.html', 'http://www.baidu.com') ~~~