From cbbe21ac2ba60c5759bdb4b08e1f720ef1fb6ba5 Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Mon, 17 Oct 2022 00:26:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=ADssl=E8=AF=81=E4=B9=A6?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/rules.db | Bin 86016 -> 86016 bytes controllers/cms.py | 12 ++++++------ js/version.txt | 2 +- "js/\345\277\253\347\234\213.js" | 24 ++++++++++++++++++++++++ readme.md | 2 ++ utils/encode.py | 6 +++--- 6 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 "js/\345\277\253\347\234\213.js" diff --git a/base/rules.db b/base/rules.db index 321ef12eddd4816bcfcda2e2feb51aa5a474def6..f41dffa7ccbb2974d81518f3d53668f9cf6da7c1 100644 GIT binary patch delta 26 icmZozz}m2Yb%Hdb%0wAwMwN{T3%VH%HZ%78KMVkM4+) diff --git a/controllers/cms.py b/controllers/cms.py index 80eef30..6e48abd 100644 --- a/controllers/cms.py +++ b/controllers/cms.py @@ -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: diff --git a/js/version.txt b/js/version.txt index 3645b29..f48bd70 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -3.9.8beta1 \ No newline at end of file +3.9.8beta2 \ No newline at end of file diff --git "a/js/\345\277\253\347\234\213.js" "b/js/\345\277\253\347\234\213.js" new file mode 100644 index 0000000..9df6b31 --- /dev/null +++ "b/js/\345\277\253\347\234\213.js" @@ -0,0 +1,24 @@ +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 diff --git a/readme.md b/readme.md index fafb0e6..efc703c 100644 --- a/readme.md +++ b/readme.md @@ -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解析 diff --git a/utils/encode.py b/utils/encode.py index e4d2416..5eab29c 100644 --- a/utils/encode.py +++ b/utils/encode.py @@ -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( -- GitLab