Skip to content

Commit 3adad49

Browse files
authored
fix(123pan): update domain www.123pan.com -> yun.123pan.com (#9571)
1 parent d0cec67 commit 3adad49

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

drivers/123/driver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func (d *Pan123) Link(ctx context.Context, file model.Obj, args model.LinkArgs)
122122
}
123123
u_ := u.String()
124124
log.Debug("download url: ", u_)
125-
res, err := base.NoRedirectClient.R().SetHeader("Referer", "https://www.123pan.com/").Get(u_)
125+
res, err := base.NoRedirectClient.R().SetHeader("Referer", "https://yun.123pan.com/").Get(u_)
126126
if err != nil {
127127
return nil, err
128128
}
@@ -137,7 +137,7 @@ func (d *Pan123) Link(ctx context.Context, file model.Obj, args model.LinkArgs)
137137
link.URL = utils.Json.Get(res.Body(), "data", "redirect_url").ToString()
138138
}
139139
link.Header = http.Header{
140-
"Referer": []string{"https://www.123pan.com/"},
140+
"Referer": []string{"https://yun.123pan.com/"},
141141
}
142142
return &link, nil
143143
} else {

drivers/123/util.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ import (
2323
// do others that not defined in Driver interface
2424

2525
const (
26-
Api = "https://www.123pan.com/api"
27-
AApi = "https://www.123pan.com/a/api"
28-
BApi = "https://www.123pan.com/b/api"
26+
Api = "https://yun.123pan.com/api"
27+
AApi = "https://yun.123pan.com/a/api"
28+
BApi = "https://yun.123pan.com/b/api"
2929
LoginApi = "https://login.123pan.com/api"
3030
MainApi = BApi
3131
SignIn = LoginApi + "/user/sign_in"
@@ -162,8 +162,8 @@ func (d *Pan123) login() error {
162162
}
163163
res, err := base.RestyClient.R().
164164
SetHeaders(map[string]string{
165-
"origin": "https://www.123pan.com",
166-
"referer": "https://www.123pan.com/",
165+
"origin": "https://yun.123pan.com",
166+
"referer": "https://yun.123pan.com/",
167167
//"user-agent": "Dart/2.19(dart:io)-alist",
168168
"platform": "web",
169169
"app-version": "3",
@@ -200,8 +200,8 @@ func (d *Pan123) Request(url string, method string, callback base.ReqCallback, r
200200
do:
201201
req := base.RestyClient.R()
202202
req.SetHeaders(map[string]string{
203-
"origin": "https://www.123pan.com",
204-
"referer": "https://www.123pan.com/",
203+
"origin": "https://yun.123pan.com",
204+
"referer": "https://yun.123pan.com/",
205205
"authorization": "Bearer " + d.AccessToken,
206206
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
207207
"platform": "web",

drivers/123_share/driver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (d *Pan123Share) Link(ctx context.Context, file model.Obj, args model.LinkA
107107
}
108108
u_ := u.String()
109109
log.Debug("download url: ", u_)
110-
res, err := base.NoRedirectClient.R().SetHeader("Referer", "https://www.123pan.com/").Get(u_)
110+
res, err := base.NoRedirectClient.R().SetHeader("Referer", "https://yun.123pan.com/").Get(u_)
111111
if err != nil {
112112
return nil, err
113113
}
@@ -122,7 +122,7 @@ func (d *Pan123Share) Link(ctx context.Context, file model.Obj, args model.LinkA
122122
link.URL = utils.Json.Get(res.Body(), "data", "redirect_url").ToString()
123123
}
124124
link.Header = http.Header{
125-
"Referer": []string{"https://www.123pan.com/"},
125+
"Referer": []string{"https://yun.123pan.com/"},
126126
}
127127
return &link, nil
128128
}

drivers/123_share/util.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import (
2020
)
2121

2222
const (
23-
Api = "https://www.123pan.com/api"
24-
AApi = "https://www.123pan.com/a/api"
25-
BApi = "https://www.123pan.com/b/api"
23+
Api = "https://yun.123pan.com/api"
24+
AApi = "https://yun.123pan.com/a/api"
25+
BApi = "https://yun.123pan.com/b/api"
2626
MainApi = BApi
2727
FileList = MainApi + "/share/get"
2828
DownloadInfo = MainApi + "/share/download/info"
@@ -58,8 +58,8 @@ func (d *Pan123Share) request(url string, method string, callback base.ReqCallba
5858
}
5959
req := base.RestyClient.R()
6060
req.SetHeaders(map[string]string{
61-
"origin": "https://www.123pan.com",
62-
"referer": "https://www.123pan.com/",
61+
"origin": "https://yun.123pan.com",
62+
"referer": "https://yun.123pan.com/",
6363
"authorization": "Bearer " + d.AccessToken,
6464
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) alist-client",
6565
"platform": "web",

0 commit comments

Comments
 (0)