fix: disable SSL certificate warnings and update proxy fetching method to use fetch_proxies1

This commit is contained in:
晓丰 2025-05-28 22:46:01 +08:00
parent d015dd8266
commit 8ed1d9d403
2 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,8 @@ from threading import Lock
from concurrent.futures import ThreadPoolExecutor, as_completed from concurrent.futures import ThreadPoolExecutor, as_completed
from logger import logger from logger import logger
import os import os
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# 构造证书文件绝对路径 # 构造证书文件绝对路径

View File

@ -170,7 +170,7 @@ def refill_queue(r: redis.Redis, region_name: str, region_code: str,
to_fetch = batch - length to_fetch = batch - length
print(f"[{time.strftime('%H:%M:%S')}] {key} 长度 {length} < {low},一次性拉取 {to_fetch} 条…") print(f"[{time.strftime('%H:%M:%S')}] {key} 长度 {length} < {low},一次性拉取 {to_fetch} 条…")
proxies = fetch_proxies2(region_code, to_fetch) proxies = fetch_proxies1(region_code, to_fetch)
if proxies: if proxies:
r.rpush(key, *proxies) r.rpush(key, *proxies)
print(f"[{time.strftime('%H:%M:%S')}] 已入队 {len(proxies)} 条 → 新长度 {r.llen(key)}") print(f"[{time.strftime('%H:%M:%S')}] 已入队 {len(proxies)} 条 → 新长度 {r.llen(key)}")