|
@@ -14,6 +14,19 @@ from fake_useragent import FakeUserAgent
|
|
|
from applications.functions.common import sensitive_flag
|
|
|
|
|
|
|
|
|
+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):
|
|
|
"""
|
|
|
获取好看视频的视频链接
|
|
@@ -76,7 +89,7 @@ def hksp_search(key, sensitive_words):
|
|
|
'x-requested-with': 'xmlhttprequest',
|
|
|
}
|
|
|
# 发送GET请求
|
|
|
- response = requests.get(url, headers=headers, params=params).json()
|
|
|
+ response = requests.get(url, headers=headers, params=params, proxies=tunnel_proxies()).json()
|
|
|
try:
|
|
|
data_list = response['data']['list']
|
|
|
L = []
|
|
@@ -91,8 +104,7 @@ def hksp_search(key, sensitive_words):
|
|
|
else:
|
|
|
continue
|
|
|
except Exception as e:
|
|
|
- print(e)
|
|
|
pass
|
|
|
return L
|
|
|
except:
|
|
|
- return []
|
|
|
+ return []
|