Skip to content

Commit

Permalink
fix(baidu_photo): cannot download when proxy is opened
Browse files Browse the repository at this point in the history
  • Loading branch information
foxxorcat committed Sep 22, 2022
1 parent 0039dc1 commit af946ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/baidu_photo/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ func (d *BaiduPhoto) linkAlbum(ctx context.Context, file model.Obj, args model.L
URL: res.Header().Get("location"),
Header: http.Header{
"User-Agent": []string{headers["User-Agent"]},
"Referer": []string{"https://photo.baidu.com/"},
},
//Expiration: &exp,
}
Expand Down Expand Up @@ -369,6 +370,7 @@ func (d *BaiduPhoto) linkFile(ctx context.Context, file model.Obj, args model.Li
URL: downloadUrl.Dlink,
Header: http.Header{
"User-Agent": []string{headers["User-Agent"]},
"Referer": []string{"https://photo.baidu.com/"},
},
//Expiration: &exp,
}
Expand Down

0 comments on commit af946ff

Please sign in to comment.