feat: 添加常量 TempDir 并更新文件下载逻辑以支持跳过已存在文件的选项
This commit is contained in:
@@ -65,7 +65,7 @@ func normalizeURL(rawURL string) string {
|
||||
}
|
||||
|
||||
// DownloadFile 下载文件到指定目录,返回带有正确扩展名的完整文件路径
|
||||
func DownloadFile(urlStr string, dirPath string) (filepath string, err error) {
|
||||
func DownloadFile(urlStr string, dirPath string, skipExist bool) (filepath string, err error) {
|
||||
// 创建fasthttp客户端
|
||||
client := &fasthttp.Client{
|
||||
ReadTimeout: 30 * time.Second,
|
||||
|
||||
Reference in New Issue
Block a user