修改 utils.get_proxies() 的代理获取逻辑,现在从配置文件中获取了。
This commit is contained in:
parent
b8e3d84c63
commit
d7240571b8
@ -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
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user