修改 utils.get_proxies() 的代理获取逻辑,现在从配置文件中获取了。
This commit is contained in:
parent
b8e3d84c63
commit
d7240571b8
@ -1,6 +1,8 @@
|
|||||||
import hashlib
|
import hashlib
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
from app.config.config import AppCtx
|
||||||
|
|
||||||
|
|
||||||
def md5(s: str) -> str:
|
def md5(s: str) -> str:
|
||||||
m = hashlib.md5()
|
m = hashlib.md5()
|
||||||
@ -9,17 +11,24 @@ def md5(s: str) -> str:
|
|||||||
|
|
||||||
|
|
||||||
def get_proxies():
|
def get_proxies():
|
||||||
username = "t14131310374591"
|
# username = "t14131310374591"
|
||||||
password = "qg6xwmrq"
|
# password = "qg6xwmrq"
|
||||||
tunnel = "d432.kdltps.com:15818"
|
# tunnel = "d432.kdltps.com:15818"
|
||||||
proxies = {
|
# proxies = {
|
||||||
"http": "http://%(user)s:%(pwd)s@%(proxy)s/" % {"user": username, "pwd": password, "proxy": tunnel},
|
# "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}
|
# "https": "http://%(user)s:%(pwd)s@%(proxy)s/" % {"user": username, "pwd": password, "proxy": tunnel}
|
||||||
}
|
# }
|
||||||
# proxies = {
|
# proxies = {
|
||||||
# "http": "http://127.0.0.1:8080",
|
# "http": "http://127.0.0.1:8080",
|
||||||
# "https": "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
|
return proxies
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user