From 3a1a4c5cfe9e34df4bd6b20f095d95ad7ef5876d Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sun, 10 Aug 2025 22:15:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20download.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/download.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/chain/download.py b/app/chain/download.py index adee5b90..28e80ef7 100644 --- a/app/chain/download.py +++ b/app/chain/download.py @@ -60,6 +60,8 @@ class DownloadChain(ChainBase): # 是否使用cookie if not req_params.get('cookie'): cookie = None + # 代理 + proxy = req_params.get('proxy') # 请求头 if req_params.get('header'): headers = req_params.get('header') @@ -70,14 +72,16 @@ class DownloadChain(ChainBase): res = RequestUtils( ua=ua, cookies=cookie, - headers=headers + headers=headers, + proxies=settings.PROXY if proxy else None ).get_res(url, params=req_params.get('params')) else: # POST请求 res = RequestUtils( ua=ua, cookies=cookie, - headers=headers + headers=headers, + proxies=settings.PROXY if proxy else None ).post_res(url, params=req_params.get('params')) if not res: return None