Repository: AlistGo/alist (language: go)

Issue:
复制文件到115网盘报错: upload failed
### Please make sure of the following things

- [X] I have read the [documentation](https://alist.nn.ci).
我已经阅读了[文档](https://alist.nn.ci)。

- [X] I'm sure there are no duplicate issues or discussions.
我确定没有重复的issue或讨论。

- [X] I'm sure it's due to `AList` and not something else(such as [Network](https://alist.nn.ci/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host) ,`Dependencies` or `Operational`).
我确定是`AList`的问题，而不是其他原因（例如[网络](https://alist.nn.ci/zh/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host)，`依赖`或`操作`）。

- [X] I'm sure this issue is not fixed in the latest version.
我确定这个问题在最新版本中没有被修复。


### AList Version / AList 版本

v3.38.0

### Driver used / 使用的存储驱动

115

### Describe the bug / 问题描述

- 版本

```bash
./alist version
Built At: 2024-10-11 17:03:33 +0000
Go Version: go1.22.4 linux/amd64
Author: Xhofe <i@nn.ci>
Commit ID: c3e43ff6
Version: v3.38.0
WebVersion: 3.38.0
```

- 问题


alist 所在服务器的本地文件(100M以上)复制到115网盘报错: upload failed
![Snipaste_2024-10-25_13-55-59](https://github.com/user-attachments/assets/322c3a87-c919-492c-b19e-a20a497a987a)

但通过网页上传文件(100M以上)到115网盘是成功的
![Snipaste_2024-10-25_13-56-45](https://github.com/user-attachments/assets/e6499594-2f11-44f4-b3bd-c5fab02a8b9e)




### Reproduction / 复现链接

详见描述

### Config / 配置

```json
{
  "force": false,
  "site_url": "",
  "cdn": "",
  "jwt_secret": "UrOws0KhRK6Q9MFY",
  "token_expires_in": 48,
  "database": {
    "type": "sqlite3",
    "host": "",
    "port": 0,
    "user": "",
    "password": "",
    "name": "",
    "db_file": "data/data.db",
    "table_prefix": "x_",
    "ssl_mode": "",
    "dsn": ""
  },
  "meilisearch": {
    "host": "http://localhost:7700",
    "api_key": "",
    "index_prefix": ""
  },
  "scheme": {
    "address": "0.0.0.0",
    "http_port": 5244,
    "https_port": -1,
    "force_https": false,
    "cert_file": "",
    "key_file": "",
    "unix_file": "",
    "unix_file_perm": ""
  },
  "temp_dir": "data/temp",
  "bleve_dir": "data/bleve",
  "dist_dir": "",
  "log": {
    "enable": true,
    "name": "data/log/log.log",
    "max_size": 50,
    "max_backups": 30,
    "max_age": 28,
    "compress": false
  },
  "delayed_start": 0,
  "max_connections": 0,
  "tls_insecure_skip_verify": true,
  "tasks": {
    "download": {
      "workers": 5,
      "max_retry": 1,
      "task_persistant": true
    },
    "transfer": {
      "workers": 5,
      "max_retry": 2,
      "task_persistant": true
    },
    "upload": {
      "workers": 5,
      "max_retry": 0,
      "task_persistant": false
    },
    "copy": {
      "workers": 5,
      "max_retry": 2,
      "task_persistant": true
    }
  },
  "cors": {
    "allow_origins": [
      "*"
    ],
    "allow_methods": [
      "*"
    ],
    "allow_headers": [
      "*"
    ]
  },
  "s3": {
    "enable": false,
    "port": 5246,
    "ssl": false
  }
}
```

### Logs / 日志

```txt
ERRO[2024-10-25 13:19:18] COPY /dav/local/live/biliup/upload/2024-10-25/星星星星星的工作室/星星星星星的工作室.2024-10-25 09_39_27.ing.flv upload failed
github.com/SheltonZhu/115driver/pkg/driver.init
	<autogenerated>:1
runtime.doInit1
	/home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-amd64/src/runtime/proc.go:7176
runtime.doInit
	/home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-amd64/src/runtime/proc.go:7143
runtime.main
	/home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-amd64/src/runtime/proc.go:253
runtime.goexit
	/home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-amd64/src/runtime/asm_amd64.s:1695
github.com/alist-org/alist/v3/internal/op.Put
	/home/runner/work/alist/alist/internal/op/fs.go:587
github.com/alist-org/alist/v3/internal/fs._copy
	/home/runner/work/alist/alist/internal/fs/copy.go:91
github.com/alist-org/alist/v3/internal/fs.Copy
	/home/runner/work/alist/alist/internal/fs/fs.go:73
github.com/alist-org/alist/v3/server/webdav.copyFiles
	/home/runner/work/alist/alist/server/webdav/file.go:59
github.com/alist-org/alist/v3/server/webdav.(*Handler).handleCopyMove
	/home/runner/work/alist/alist/server/webdav/webdav.go:477
github.com/alist-org/alist/v3/server/webdav.(*Handler).ServeHTTP
	/home/runner/work/alist/alist/server/webdav/webdav.go:70
github.com/alist-org/alist/v3/server.ServeWebDAV
	/home/runner/work/alist/alist/server/webdav.go:46
github.com/gin-gonic/gin.(*Context).Next
	/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/alist-org/alist/v3/server.WebDAVAuth
	/home/runner/work/alist/alist/server/webdav.go:113
github.com/gin-gonic/gin.(*Context).Next
	/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/alist-org/alist/v3/server/middlewares.StoragesLoaded
	/home/runner/work/alist/alist/server/middlewares/check.go:14
github.com/gin-gonic/gin.(*Context).Next
	/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1
	/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102
github.com/gin-gonic/gin.(*Context).Next
	/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.LoggerWithConfig.func1
	/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249
github.com/gin-gonic/gin.(*Context).Next
	/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633
github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589
net/http.serverHandler.ServeHTTP
	/home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-amd64/src/net/http/server.go:3137
net/http.(*conn).serve
	/home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-amd64/src/net/http/server.go:2039
runtime.goexit
	/home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.4.linux-amd64/src/runtime/asm_amd64.s:1695 
[GIN] 2024/10/25 - 13:19:18 | 500 | 39.043209803s |       127.0.0.1 | COPY     "/dav/local/live/biliup/upload/2024-10-25/星星星星星的工作室/星星星星星的工作室.2024-10-25 09_39_27.ing.flv"
```


Discussion / hints:
+1，上传5m的zip都不行
+1
准确地说，是秒传还可以用，但全新完整地上传是报错的，就是提示"Upload failed"
> +1 准确地说，是秒传还可以用，但全新完整地上传是报错的，就是提示“Upload failed”

是的，现在我网页上传一个未上传过的文件报: 
```txt
{"StatusCode":"400","ErrorCode":"400","ErrorMessage":"Throttling.User"}: unexpected error
```
+1
上传文件报错：{"StatusCode":"400","ErrorCode":"400","ErrorMessage":"Throttling.User"}: unexpected error
+1
+1
can't obtain oss token from here https://uplb.115.com/3.0/gettoken.php which gives `{"StatusCode":"400","ErrorCode":"400","ErrorMessage":"Throttling.User"}`
> > +1 准确地说，是秒传还可以用，但全新完整地上传是报错的，就是提示“Upload failed”
> 
> 是的，现在我网页上传一个未上传过的文件报:
> 
> ```
> {"StatusCode":"400","ErrorCode":"400","ErrorMessage":"Throttling.User"}: unexpected error
> ```

确实是这样，upload failed 和 400 Throttling.User 交替出现
+1
关注中
+1
是的, 最近突然出现的问题
同样的问题，期待修复，感谢
115调整接口了，期待大佬修复
期待大佬早日修复解决  非常感谢
+1，希望尽快修复
mark
相同问题,期待修复
+1 相同问题,期待修复
猜测是115再次收紧API以及上传限制
+1
等大佬修复
+1
频繁更新接口，官方开始打击三方了，项目风险很高
https://github.com/orzogc/fake115uploader/issues/74#issuecomment-2443455879

这个串有定位到问题。

@xhofe 
> +1 准确地说，是秒传还可以用，但全新完整地上传是报错的，就是提示"Upload failed"
@KeithW0726 
+1

Fix patch:
diff --git a/drivers/115/driver.go b/drivers/115/driver.go
index 4857c1ec05e..f6fb6b05618 100644
--- a/drivers/115/driver.go
+++ b/drivers/115/driver.go
@@ -2,7 +2,6 @@ package _115
 
 import (
 	"context"
-	"fmt"
 	"strings"
 	"sync"
 
@@ -122,10 +121,7 @@ func (d *Pan115) Put(ctx context.Context, dstDir model.Obj, stream model.FileStr
 	if err := d.WaitLimit(ctx); err != nil {
 		return err
 	}
-	if stream.GetSize() > utils.GB*20 { // TODO 由于官方分片上传接口失效，所以使用普通上传小于20GB的文件
-		return fmt.Errorf("unsupported file size: 20GB limit exceeded")
-	}
-	// 分片上传
+
 	var (
 		fastInfo *driver115.UploadInitResp
 		dirID    = dstDir.GetID()
@@ -181,13 +177,11 @@ func (d *Pan115) Put(ctx context.Context, dstDir model.Obj, stream model.FileStr
 	}
 
 	// 闪传失败，上传
-	// if stream.GetSize() <= utils.KB{ // 文件大小小于1KB，改用普通模式上传
-	if stream.GetSize() <= utils.GB*20 { // TODO 由于官方分片上传接口失效，所以使用普通上传小于20GB的文件
+	if stream.GetSize() <= utils.KB { // 文件大小小于1KB，改用普通模式上传
 		return d.client.UploadByOSS(&fastInfo.UploadOSSParams, stream, dirID)
 	}
-	return driver115.ErrUnexpected
 	// 分片上传
-	// return d.UploadByMultipart(&fastInfo.UploadOSSParams, stream.GetSize(), stream, dirID)
+	return d.UploadByMultipart(&fastInfo.UploadOSSParams, stream.GetSize(), stream, dirID)
 }
 
 func (d *Pan115) OfflineList(ctx context.Context) ([]*driver115.OfflineTask, error) {


Test patch: