提交 cbbe21ac 编写于 作者: H hjdhnx

关闭ssl证书验证

上级 f0969be2
无法预览此类型文件
......@@ -392,7 +392,7 @@ class CMS:
cookies_dict = requests.utils.dict_from_cookiejar(r.cookies)
cookie_str = ';'.join([f'{k}={cookies_dict[k]}' for k in cookies_dict])
self.headers['cookie'] = cookie_str
r = requests.get(url, headers=self.headers, timeout=self.timeout)
r = requests.get(url, headers=self.headers, timeout=self.timeout,verify=False)
r.encoding = self.encoding
html = r.text
if html.find('?btwaf=') < 0:
......@@ -466,7 +466,7 @@ class CMS:
pass
else:
new_classes = []
r = requests.get(self.homeUrl, headers=self.headers, timeout=self.timeout)
r = requests.get(self.homeUrl, headers=self.headers, timeout=self.timeout,verify=False)
html = self.checkHtml(r)
# print(html)
# print(self.headers)
......@@ -754,7 +754,7 @@ class CMS:
items = []
try:
r = requests.get(url, headers=self.headers, timeout=self.timeout)
r = requests.get(url, headers=self.headers, timeout=self.timeout,verify=False)
html = self.checkHtml(r)
print(self.headers)
# print(html)
......@@ -831,7 +831,7 @@ class CMS:
obj = {}
vod_name = ''
if not html: # 没传递html参数接下来智能获取
r = requests.get(url, headers=self.headers, timeout=self.timeout)
r = requests.get(url, headers=self.headers, timeout=self.timeout,verify=False)
html = self.checkHtml(r)
if is_json:
html = self.dealJson(html)
......@@ -1136,7 +1136,7 @@ class CMS:
pd = jsp.pj if is_json else jsp.pd
pq = jsp.pq
try:
r = requests.get(url, headers=self.headers,timeout=self.timeout)
r = requests.get(url, headers=self.headers,timeout=self.timeout,verify=False)
html = self.checkHtml(r)
if is_json:
html = self.dealJson(html)
......@@ -1152,7 +1152,7 @@ class CMS:
}
self.saveCookie(cookie)
self.headers['cookie'] = cookie
r = requests.get(url, headers=self.headers, timeout=self.timeout)
r = requests.get(url, headers=self.headers, timeout=self.timeout,verify=False)
r.encoding = self.encoding
html = r.text
if not show_name and not str(html).find(key) > -1:
......
3.9.8beta1
\ No newline at end of file
3.9.8beta2
\ No newline at end of file
var rule={
title:'快看',
host:'https://www.kuaikanys.net',
// homeUrl:'/',
url:'/s/fyclass/page/fypage.html',
searchUrl:'/vodsearch/-------------.html?wd=**&submit=',
searchable:2,//是否启用全局搜索,
quickSearch:1,//是否启用快速搜索,
filterable:0,//是否启用分类筛选,
headers:{//网站的请求头,完整支持所有的,常带ua和cookies
'User-Agent':'MOBILE_UA',
// "Cookie": "searchneed=ok"
},
class_name:'电影&连续剧&综艺&动漫',
class_url:'dianying&lianxuju&zongyi&dongman',
play_parse:true,
lazy:'',
limit:6,
推荐:'.show;ul&&li;a&&title;img&&src;.score&&Text;a&&href',
double:true, // 推荐内容是否双层定位
一级:'.row&&li;a&&title;img&&src;.score&&Text;a&&href',
二级:{"title":"h1&&Text;.info&&ul&&p&&Text","img":"img&&src","desc":".info&&ul&&p:eq(-2)&&Text;.info&&ul&&p:eq(-1)&&Text;.info&&ul&&p:eq(0)&&Text;.info&&ul&&p:eq(1)&&Text;.info&&ul&&p:eq(2)&&Text;.info&&ul&&p:eq(3)&&Text","content":".text&&Text","tabs":".play&&span","lists":".playlist&&ul:eq(#id) li"},
搜索:'.row&&li;a&&title;img&&src;.score&&Text;a&&href',
}
\ No newline at end of file
......@@ -47,6 +47,8 @@
[dockerfile教程](https://blog.csdn.net/qq_46158060/article/details/125718218)
[获取本地设备信息](https://blog.csdn.net/cui_yonghua/article/details/125508991)
[获取本地设备信息](https://m.jb51.net/article/140716.htm)
###### 2022/10/17
- [X] 3.9.8beta2 全局关闭https对应的ssl证书验证
###### 2022/10/16
- [X] 3.9.8 完成ddys选集播放和免嗅(可惜我刚弄完没播放俩个剧就被封ip了)
- [X] 3.9.8beta1 增加了俩自建js解析
......
......@@ -61,7 +61,7 @@ def requireCache(lib:str):
r = requests.get(lib,headers={
'Referer': lib,
'User-Agent': UC_UA,
},timeout=5)
},timeout=5,verify=False)
with open(lib_path,mode='wb+') as f:
f.write(r.content)
code = r.text
......@@ -86,7 +86,7 @@ class OcrApi:
def classification(self,img):
try:
code = requests.post(self.api,data=img,headers={'user-agent':PC_UA}).text
code = requests.post(self.api,data=img,headers={'user-agent':PC_UA},verify=False).text
except Exception as e:
print(f'ocr识别发生错误:{e}')
code = ''
......@@ -106,7 +106,7 @@ def verifyCode(url,headers,timeout=5,total_cnt=3,api=None):
while cnt < total_cnt:
s = requests.session()
try:
img = s.get(url=f"{host}/index.php/verify/index.html", headers=headers,timeout=timeout).content
img = s.get(url=f"{host}/index.php/verify/index.html", headers=headers,timeout=timeout,verify=False).content
code = ocr.classification(img)
print(f'第{cnt+1}次验证码识别结果:{code}')
res = s.post(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册