Skip to content

Commit 2bdc5be

Browse files
authored
Merge pull request #9207 from AlistGo/fix-aliyundirve
fix: update DriveId assignment to use DeviceID from Addition struct
2 parents 9da56ba + 13ea1c1 commit 2bdc5be

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

drivers/123/util.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ func (d *Pan123) login() error {
161161
}
162162
res, err := base.RestyClient.R().
163163
SetHeaders(map[string]string{
164-
"origin": "https://www.123pan.com",
165-
"referer": "https://www.123pan.com/",
166-
"user-agent": "Dart/2.19(dart:io)-alist",
164+
"origin": "https://www.123pan.com",
165+
"referer": "https://www.123pan.com/",
166+
//"user-agent": "Dart/2.19(dart:io)-alist",
167167
"platform": "web",
168168
"app-version": "3",
169-
//"user-agent": base.UserAgent,
169+
"user-agent": base.UserAgent,
170170
}).
171171
SetBody(body).Post(SignIn)
172172
if err != nil {
@@ -202,7 +202,7 @@ do:
202202
"origin": "https://www.123pan.com",
203203
"referer": "https://www.123pan.com/",
204204
"authorization": "Bearer " + d.AccessToken,
205-
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) alist-client",
205+
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",
206206
"platform": "web",
207207
"app-version": "3",
208208
//"user-agent": base.UserAgent,

drivers/aliyundrive/driver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (d *AliDrive) Init(ctx context.Context) error {
5555
if err != nil {
5656
return err
5757
}
58-
d.DriveId = utils.Json.Get(res, "default_drive_id").ToString()
58+
d.DriveId = d.Addition.DeviceID
5959
d.UserID = utils.Json.Get(res, "user_id").ToString()
6060
d.cron = cron.NewCron(time.Hour * 2)
6161
d.cron.Do(func() {

drivers/aliyundrive/meta.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77

88
type Addition struct {
99
driver.RootID
10-
RefreshToken string `json:"refresh_token" required:"true"`
11-
//DeviceID string `json:"device_id" required:"true"`
10+
RefreshToken string `json:"refresh_token" required:"true"`
11+
DeviceID string `json:"device_id" required:"true"`
1212
OrderBy string `json:"order_by" type:"select" options:"name,size,updated_at,created_at"`
1313
OrderDirection string `json:"order_direction" type:"select" options:"ASC,DESC"`
1414
RapidUpload bool `json:"rapid_upload"`

0 commit comments

Comments
 (0)