feat: 更新 flask_app.py 以使用代理代码获取视频信息,并添加项目配置文件
This commit is contained in:
parent
402307d36a
commit
f17ff34563
@ -40,6 +40,7 @@ headers1 = {
|
|||||||
}
|
}
|
||||||
_headers_cache = None # 保存最近一次成功的 headers
|
_headers_cache = None # 保存最近一次成功的 headers
|
||||||
_cache_lock = Lock()
|
_cache_lock = Lock()
|
||||||
|
proxiesdict = db.get_proxy_agent_dict()
|
||||||
|
|
||||||
|
|
||||||
def post_with_retry(url, proxy_name, json_payload=None, data=None, headers=None,
|
def post_with_retry(url, proxy_name, json_payload=None, data=None, headers=None,
|
||||||
@ -199,9 +200,10 @@ def submit():
|
|||||||
results = {}
|
results = {}
|
||||||
v_xid = data['v_xid']
|
v_xid = data['v_xid']
|
||||||
rn = data['rn']
|
rn = data['rn']
|
||||||
|
proxy_code = proxiesdict[rn]
|
||||||
print(f"收到请求: {v_xid}, {rn}")
|
print(f"收到请求: {v_xid}, {rn}")
|
||||||
headers = gettoken(rn)
|
headers = gettoken(proxy_code)
|
||||||
results = get_videoInfo(v_xid, rn, headers)
|
results = get_videoInfo(v_xid, proxy_code, headers)
|
||||||
return jsonify({
|
return jsonify({
|
||||||
"results": results
|
"results": results
|
||||||
}), 200
|
}), 200
|
||||||
|
Loading…
x
Reference in New Issue
Block a user