Repository: AlistGo/alist (language: go)

Issue:
天翼云盘已经失效
### Please make sure of the following things

- [X] I have read the [documentation](https://alist-doc.nn.ci).
- [X] I'm sure there are no duplicate issues or discussions.
- [X] I'm sure it's due to `alist` and not something else(such as `Dependencies` or `Operational`).

### Alist Version / Alist 版本

Docker

### Describe the bug / 问题描述

天翼云盘已经失效
报 get:错误


### Reproduction / 复现链接

request url: https://cloud.189.cn/api/portal/loginUrl.action?redirectURL=https%3A%2F%2Fcloud.189.cn%2Fmain.action 
[GIN] 2022/05/31 - 02:51:09 | 200 |  3.267020153s |  182.86.131.246 | POST     "/api/public/path"
[GIN] 2022/05/31 - 03:56:55 | 200 |      252.66µs |  123.14.248.156 | GET      "/1"
[GIN] 2022/05/31 - 03:57:02 | 200 |     196.872µs |    14.204.44.85 | GET      "/"
[GIN] 2022/05/31 - 03:57:27 | 200 |     588.564µs | 182.138.158.213 | GET      "/"
[GIN] 2022/05/31 - 03:57:37 | 200 |     245.424µs |  112.66.102.107 | GET      "/"
[GIN] 2022/05/31 - 03:57:38 | 200 |       185.7µs |   112.66.111.98 | GET      "/conf.js"
[GIN] 2022/05/31 - 04:48:02 | 200 |       1.916ms |  182.86.131.246 | GET      "/api/public/settings"
ERRO[2022-05-31 04:48:02] Invalid token                                
[GIN] 2022/05/31 - 04:48:02 | 200 |     213.013µs |  182.86.131.246 | GET      "/api/admin/settings?group=1"
[GIN] 2022/05/31 - 04:48:02 | 200 |     860.187µs |  182.86.131.246 | POST     "/api/public/path"
ERRO[2022-05-31 04:48:05] Invalid token                                
[GIN] 2022/05/31 - 04:48:05 | 200 |     182.076µs |  182.86.131.246 | GET      "/api/admin/settings?group=1"
[GIN] 2022/05/31 - 04:48:05 | 200 |    2.178777ms |  182.86.131.246 | GET      "/api/public/settings"
ERRO[2022-05-31 04:48:09] get page:  
status: 403 


### Logs / 日志

```shell
request url: https://cloud.189.cn/api/portal/loginUrl.action?redirectURL=https%3A%2F%2Fcloud.189.cn%2Fmain.action 
[GIN] 2022/05/31 - 02:51:09 | 200 |  3.267020153s |  182.86.131.246 | POST     "/api/public/path"
[GIN] 2022/05/31 - 03:56:55 | 200 |      252.66µs |  123.14.248.156 | GET      "/1"
[GIN] 2022/05/31 - 03:57:02 | 200 |     196.872µs |    14.204.44.85 | GET      "/"
[GIN] 2022/05/31 - 03:57:27 | 200 |     588.564µs | 182.138.158.213 | GET      "/"
[GIN] 2022/05/31 - 03:57:37 | 200 |     245.424µs |  112.66.102.107 | GET      "/"
[GIN] 2022/05/31 - 03:57:38 | 200 |       185.7µs |   112.66.111.98 | GET      "/conf.js"
[GIN] 2022/05/31 - 04:48:02 | 200 |       1.916ms |  182.86.131.246 | GET      "/api/public/settings"
ERRO[2022-05-31 04:48:02] Invalid token                                
[GIN] 2022/05/31 - 04:48:02 | 200 |     213.013µs |  182.86.131.246 | GET      "/api/admin/settings?group=1"
[GIN] 2022/05/31 - 04:48:02 | 200 |     860.187µs |  182.86.131.246 | POST     "/api/public/path"
ERRO[2022-05-31 04:48:05] Invalid token                                
[GIN] 2022/05/31 - 04:48:05 | 200 |     182.076µs |  182.86.131.246 | GET      "/api/admin/settings?group=1"
[GIN] 2022/05/31 - 04:48:05 | 200 |    2.178777ms |  182.86.131.246 | GET      "/api/public/settings"
ERRO[2022-05-31 04:48:09] get page:  
status: 403
```



Discussion / hints:
Thanks for opening your first issue here! Be sure to follow the issue template!

duplicate with #1180

Fix patch:
diff --git a/drivers/189/189.go b/drivers/189/189.go
index 069c13cdc4c..fe611adfca5 100644
--- a/drivers/189/189.go
+++ b/drivers/189/189.go
@@ -7,13 +7,6 @@ import (
 	"encoding/hex"
 	"errors"
 	"fmt"
-	"github.com/Xhofe/alist/conf"
-	"github.com/Xhofe/alist/drivers/base"
-	"github.com/Xhofe/alist/model"
-	"github.com/Xhofe/alist/utils"
-	"github.com/go-resty/resty/v2"
-	jsoniter "github.com/json-iterator/go"
-	log "github.com/sirupsen/logrus"
 	"io"
 	"math"
 	"net/http"
@@ -21,6 +14,14 @@ import (
 	"strconv"
 	"strings"
 	"time"
+
+	"github.com/Xhofe/alist/conf"
+	"github.com/Xhofe/alist/drivers/base"
+	"github.com/Xhofe/alist/model"
+	"github.com/Xhofe/alist/utils"
+	"github.com/go-resty/resty/v2"
+	jsoniter "github.com/json-iterator/go"
+	log "github.com/sirupsen/logrus"
 )
 
 var client189Map map[string]*resty.Client
@@ -98,6 +99,7 @@ func (driver Cloud189) Login(account *model.Account) error {
 	client.SetTimeout(base.DefaultTimeout)
 	client.SetRetryCount(3)
 	client.SetHeader("Referer", "https://cloud.189.cn/")
+	client.SetHeader("User-Agent", base.UserAgent)
 	url := "https://cloud.189.cn/api/portal/loginUrl.action?redirectURL=https%3A%2F%2Fcloud.189.cn%2Fmain.action"
 	b := ""
 	lt := ""
diff --git a/drivers/189/driver.go b/drivers/189/driver.go
index 5cab1f76b9f..1b9ab510bb4 100644
--- a/drivers/189/driver.go
+++ b/drivers/189/driver.go
@@ -2,15 +2,16 @@ package _89
 
 import (
 	"fmt"
+	"net/http"
+	"path/filepath"
+	"strings"
+
 	"github.com/Xhofe/alist/conf"
 	"github.com/Xhofe/alist/drivers/base"
 	"github.com/Xhofe/alist/model"
 	"github.com/Xhofe/alist/utils"
 	"github.com/go-resty/resty/v2"
 	log "github.com/sirupsen/logrus"
-	"net/http"
-	"path/filepath"
-	"strings"
 )
 
 type Cloud189 struct{}
@@ -179,23 +180,27 @@ func (driver Cloud189) Link(args base.Args, account *model.Account) (*base.Link,
 		resty.RedirectPolicyFunc(func(req *http.Request, via []*http.Request) error {
 			return http.ErrUseLastResponse
 		}))
-	res, err := client.R().Get("https:" + resp.FileDownloadUrl)
+	res, err := client.R().SetHeader("User-Agent", base.UserAgent).Get("https:" + resp.FileDownloadUrl)
 	if err != nil {
 		return nil, err
 	}
 	log.Debugln(res.Status())
+	log.Debugln(res.String())
 	link := base.Link{
 		Headers: []base.Header{
 			{Name: "User-Agent", Value: base.UserAgent},
 			//{Name: "Authorization", Value: ""},
 		},
 	}
+	log.Debugln("first url:", resp.FileDownloadUrl)
 	if res.StatusCode() == 302 {
 		link.Url = res.Header().Get("location")
-		res, err = client.R().Get(link.Url)
+		log.Debugln("second url:", link.Url)
+		_, _ = client.R().Get(link.Url)
 		if res.StatusCode() == 302 {
 			link.Url = res.Header().Get("location")
 		}
+		log.Debugln("third url:", link.Url)
 	} else {
 		link.Url = resp.FileDownloadUrl
 	}
diff --git a/server/common/proxy.go b/server/common/proxy.go
index e6a2174e5e8..ed8ee2c47d9 100644
--- a/server/common/proxy.go
+++ b/server/common/proxy.go
@@ -26,7 +26,7 @@ func Proxy(w http.ResponseWriter, r *http.Request, link *base.Link, file *model.
 			_ = link.Data.Close()
 		}()
 		w.Header().Set("Content-Type", "application/octet-stream")
-		w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename=%s`, file.Name))
+		w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, file.Name, url.QueryEscape(file.Name)))
 		w.Header().Set("Content-Length", strconv.FormatInt(file.Size, 10))
 		if link.Header != nil {
 			for h, val := range link.Header {
@@ -57,7 +57,7 @@ func Proxy(w http.ResponseWriter, r *http.Request, link *base.Link, file *model.
 		if err != nil {
 			return err
 		}
-		w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename=%s`, url.QueryEscape(file.Name)))
+		w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"; filename*=UTF-8''%s`, file.Name, url.QueryEscape(file.Name)))
 		http.ServeContent(w, r, file.Name, fileStat.ModTime(), f)
 		return nil
 	} else {


Test patch: