mirror of
https://git.oceanpay.cc/danial/kami_walmart_slide.git
synced 2025-12-18 22:49:25 +00:00
- 在 config.py 中新增静态方法 get_proxy_url(),用于获取代理 API 地址 - 在 proxy_pool.py 中将代理 API 地址修改为使用 config.get_proxy_url() 方法 - 在 Dockerfile 中添加默认的 PROXY_URL 环境变量设置
35 lines
838 B
Python
35 lines
838 B
Python
import os
|
|
|
|
from proxy_pool.enums import ProxyPoolType
|
|
|
|
|
|
|
|
class Config:
|
|
@staticmethod
|
|
def get_proxy_user() -> str:
|
|
env = os.getenv("PROXY_USER", "6CF4CD53")
|
|
if not env:
|
|
env = "6CF4CD53"
|
|
return env
|
|
|
|
@staticmethod
|
|
def get_proxy_pass() -> str:
|
|
env = os.getenv("PROXY_PASS", "0E03825E822B")
|
|
if not env:
|
|
env = "0E03825E822B"
|
|
return env
|
|
|
|
@staticmethod
|
|
def get_proxy_type() -> ProxyPoolType:
|
|
env = os.getenv("PROXY_TYPE", "default")
|
|
if not env:
|
|
env = ProxyPoolType.DEFAULT
|
|
return ProxyPoolType(env)
|
|
|
|
@staticmethod
|
|
def get_proxy_url() -> str:
|
|
env = os.getenv("PROXY_URL", "https://overseas.proxy.qg.net/get")
|
|
if not env:
|
|
env = "https://share.proxy.qg.net/get"
|
|
return env
|