From f9bc815b942902c087fd523ed6374d4bd23f5883 Mon Sep 17 00:00:00 2001 From: winter <664946893@qq.com> Date: Sun, 27 Apr 2025 19:28:12 +0800 Subject: [PATCH] fix --- bjairAdmin/src/main/resources/sh/secode.py | 101 +++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 bjairAdmin/src/main/resources/sh/secode.py diff --git a/bjairAdmin/src/main/resources/sh/secode.py b/bjairAdmin/src/main/resources/sh/secode.py new file mode 100644 index 0000000..bec4507 --- /dev/null +++ b/bjairAdmin/src/main/resources/sh/secode.py @@ -0,0 +1,101 @@ +import requests +import time +import ddddocr +#import redis +def get_baiyun(): + + session = requests.Session() + captcha_url = "http://183.63.156.34:808/vems/login!secode.action?T=1745722152384" + + response = session.get(captcha_url) + with open('captcha.jpg', 'wb') as f: + f.write(response.content) + #img_bytes = f.read() + + with open('captcha.jpg', 'rb') as f1: + img_bytes = f1.read() + ocr = ddddocr.DdddOcr() + captcha_code = ocr.classification(img_bytes) + print('captcha>>>>>'+captcha_code) + + login_url = "http://183.63.156.34:808/vems/login!doLogin.action" + payload = {'username':'FWB','password':'SC123456','secode':captcha_code} + headers = { + 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', + 'Accept-Encoding': 'gzip, deflate', + 'Accept-Language': 'zh-CN,zh;q=0.9', + 'Connection': 'keep-alive', + 'Content-Type':'application/x-www-form-urlencoded', + 'Host': '183.63.156.34:808', + 'Referer': 'http://183.63.156.34:808/vems/login.action', + 'Upgrade-Insecure-Requests': '1', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36', + } + + response = session.post(login_url, headers=headers, data=payload) + text = response.text + #print(text) + + local_date_str = time.strftime("%Y-%m-%d", time.localtime()) + print('locadatestr>>>>'+local_date_str) + business_url = "http://183.63.156.34:808/vems/parkoperation/present-car!list.action?filter_I_parkingLotSeq=4&filter_I_licenseOrRandomCode=1&filter_S_carLicenseNumber=&filter_S_enterTimePeriod="+local_date_str+"+00%3A00%3A00+-+"+local_date_str+"+23%3A59%3A59&filter_I_recordType=&filter_I_isCorrect=&filter_I_confidence=100&filter_I_parkingTime=&filter_S_enterChannel=&filter_S_enterVipTypeAndName=&filter_I_openModel=&filter_S_openOperator=&filter_I_parkingAreaSeq=&filter_I_uploadYDT=&filter_S_flag=1&pageParam.pageNum=1&pageParam.pageSize=10" + + business_payload = {} + business_headers = { + #'Cookie': 'JSESSIONID=F5467599E1B0A528F7444C69909DAAB0', + 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', + 'Accept-Encoding': 'gzip, deflate', + 'Accept-Language': 'zh-CN,zh;q=0.9', + 'Connection': 'keep-alive', + 'Host': '183.63.156.34:808', + 'Referer': 'http://183.63.156.34:808/vems/parkoperation/present-car!list.action?menuID=', + 'Upgrade-Insecure-Requests': '1', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36', + } + + response = session.get(business_url, headers=business_headers, data=business_payload) + text = response.text + #print(text) + key1= "