|
@@ -9,6 +9,18 @@ import hashlib
|
|
|
|
|
|
from applications.functions.common import MySQLServer
|
|
|
|
|
|
+def tunnel_proxies():
|
|
|
+ # 隧道域名:端口号
|
|
|
+ tunnel = "q796.kdltps.com:15818"
|
|
|
+ # 用户名密码方式
|
|
|
+ username = "t17772369458618"
|
|
|
+ password = "5zqcjkmy"
|
|
|
+ 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}
|
|
|
+ }
|
|
|
+ return proxies
|
|
|
+
|
|
|
|
|
|
def get_video_detail(video_id):
|
|
|
"""
|
|
@@ -36,7 +48,13 @@ def get_video_detail(video_id):
|
|
|
'Referer': 'https://haokan.baidu.com',
|
|
|
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
|
|
|
}
|
|
|
- response = requests.request("GET", url, headers=headers, params=params).json()
|
|
|
+ response = requests.request(
|
|
|
+ "GET",
|
|
|
+ url,
|
|
|
+ headers=headers,
|
|
|
+ params=params,
|
|
|
+ proxies=tunnel_proxies()
|
|
|
+ ).json()
|
|
|
return response['data']['apiData']['curVideoMeta']
|
|
|
|
|
|
|
|
@@ -98,3 +116,7 @@ def hksp_search(key):
|
|
|
except:
|
|
|
pass
|
|
|
return L
|
|
|
+
|
|
|
+
|
|
|
+L = hksp_search("【头次】对拜登背后放冷枪,越南干得漂亮,俄罗斯立功,中国成赢家!")
|
|
|
+print(L)
|