From af946ff13e7f53db4863bb8ff76162649f7d3326 Mon Sep 17 00:00:00 2001 From: foxxorcat Date: Fri, 23 Sep 2022 01:15:12 +0800 Subject: [PATCH] fix(baidu_photo): cannot download when proxy is opened --- drivers/baidu_photo/utils.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/baidu_photo/utils.go b/drivers/baidu_photo/utils.go index 48bffaa80f4..3aa763af0f2 100644 --- a/drivers/baidu_photo/utils.go +++ b/drivers/baidu_photo/utils.go @@ -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, } @@ -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, }