From d7240571b8ab21bae7ab1cb6a96135ab746bfe55 Mon Sep 17 00:00:00 2001 From: xhy Date: Tue, 8 Apr 2025 20:33:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20utils.get=5Fproxies()=20?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=90=86=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E7=8E=B0=E5=9C=A8=E4=BB=8E=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E8=8E=B7=E5=8F=96=E4=BA=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/utils/common.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/app/utils/common.py b/app/utils/common.py index 2b2655f..14d9dfa 100644 --- a/app/utils/common.py +++ b/app/utils/common.py @@ -1,6 +1,8 @@ import hashlib import random +from app.config.config import AppCtx + def md5(s: str) -> str: m = hashlib.md5() @@ -9,17 +11,24 @@ def md5(s: str) -> str: def get_proxies(): - username = "t14131310374591" - password = "qg6xwmrq" - tunnel = "d432.kdltps.com:15818" - proxies = { - "http": "http://%(user)s:%(pwd)s@%(proxy)s/" % {"user": username, "pwd": password, "proxy": tunnel}, - "https": "http://%(user)s:%(pwd)s@%(proxy)s/" % {"user": username, "pwd": password, "proxy": tunnel} - } + # username = "t14131310374591" + # password = "qg6xwmrq" + # tunnel = "d432.kdltps.com:15818" + # proxies = { + # "http": "http://%(user)s:%(pwd)s@%(proxy)s/" % {"user": username, "pwd": password, "proxy": tunnel}, + # "https": "http://%(user)s:%(pwd)s@%(proxy)s/" % {"user": username, "pwd": password, "proxy": tunnel} + # } # proxies = { # "http": "http://127.0.0.1:8080", # "https": "http://127.0.0.1:8080" # } + + proxy = AppCtx.g_app_config.chrome.proxy + proxies = { + "http": proxy, + "https": proxy + } + return proxies