From 8239dde04c3ff12a8820c458aae2e63afeec48b7 Mon Sep 17 00:00:00 2001 From: Franklin-F Date: Sat, 17 May 2025 12:43:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=B9=E6=B3=95=E4=BB=A5=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E4=BB=A3=E7=A0=81=E5=B9=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E4=BB=A3=E7=90=86=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DB.py | 3 +-- main.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DB.py b/DB.py index b33a165..8c02fb3 100644 --- a/DB.py +++ b/DB.py @@ -252,12 +252,11 @@ class DBVidcon: self.cursor.close() self.conn.close() - def get_proxy(self, region_name: str) -> str: + def get_proxy(self, region_code: str) -> str: """ 从 Redis 队列 proxy_queue: 弹出一个代理并返回。 如果队列为空,阻塞 """ - region_code = self.get_proxy_parameter(region_name) proxy = "" while True: key = f"proxy_queue:{region_code}" diff --git a/main.py b/main.py index b2fb401..6485991 100644 --- a/main.py +++ b/main.py @@ -694,8 +694,9 @@ def integrate_data(): else: for index, (payload, kitem) in enumerate(keywords): try: + proxiesdict = db.get_proxy_agent_dict() global Gproxies - Gproxies = kitem['rn'] + Gproxies = proxiesdict[kitem['rn']] v_list = get_searchInfo(kitem['keyword']) if not v_list: