From 40edc8746d5574a704b4cc861c1f886cfe650daf Mon Sep 17 00:00:00 2001 From: 3288588344 <127068117+3288588344@users.noreply.github.com> Date: Wed, 19 Mar 2025 19:28:22 +0800 Subject: [PATCH] Add files via upload --- Ruishu.py | 268 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 268 insertions(+) create mode 100644 Ruishu.py diff --git a/Ruishu.py b/Ruishu.py new file mode 100644 index 0000000..0fa9935 --- /dev/null +++ b/Ruishu.py @@ -0,0 +1,268 @@ + +/* +#TL库:https://github.com/3288588344/toulu.git +#tg频道:https://t.me/TLtoulu +#QQ频道:https://pd.qq.com/s/672fku8ge +#微信机器人:kckl6688 +#公众号:哆啦A梦的藏宝箱 +*/ + + + + + +import os +import ssl +import time +import json +import execjs +import base64 +import random +import certifi +import aiohttp +import asyncio +import requests +from http import cookiejar +from Crypto.Cipher import DES3 +from Crypto.Util.Padding import pad, unpad +from aiohttp import ClientSession, TCPConnector +import httpx +httpx._config.DEFAULT_CIPHERS += ":ALL:@SECLEVEL=1" +diffValue = 2 +filename='Cache.js' +if os.path.exists(filename): + with open(filename, 'r', encoding='utf-8') as file: + fileContent = file.read() +else: + fileContent='' + +class BlockAll(cookiejar.CookiePolicy): + return_ok = set_ok = domain_return_ok = path_return_ok = lambda self, *args, **kwargs: False + netscape = True + rfc2965 = hide_cookie2 = False + +def printn(m): + print(f'\n{m}') + +context = ssl.create_default_context() +context.set_ciphers('DEFAULT@SECLEVEL=1') # 低安全级别0/1 +context.check_hostname = False # 禁用主机 +context.verify_mode = ssl.CERT_NONE # 禁用证书 + +class DESAdapter(requests.adapters.HTTPAdapter): + def init_poolmanager(self, *args, **kwargs): + kwargs['ssl_context'] = context + return super().init_poolmanager(*args, **kwargs) + +requests.DEFAULT_RETRIES = 0 +requests.packages.urllib3.disable_warnings() +ss = requests.session() +ss.headers = {"User-Agent": "Mozilla/5.0 (Linux; Android 13; 22081212C Build/TKQ1.220829.002) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.97 Mobile Safari/537.36", "Referer": "https://wapact.189.cn:9001/JinDouMall/JinDouMall_independentDetails.html"} +ss.mount('https://', DESAdapter()) +ss.cookies.set_policy(BlockAll()) +runTime = 0 +sleepTime = 1 +key = b'1234567`90koiuyhgtfrdews' +iv = 8 * b'\0' + +def encrypt(text): + cipher = DES3.new(key, DES3.MODE_CBC, iv) + ciphertext = cipher.encrypt(pad(text.encode(), DES3.block_size)) + return ciphertext.hex() + +def decrypt(text): + ciphertext = bytes.fromhex(text) + cipher = DES3.new(key, DES3.MODE_CBC, iv) + plaintext = unpad(cipher.decrypt(ciphertext), DES3.block_size) + return plaintext.decode() + +def initCookie(getUrl='https://wapact.189.cn:9001/gateway/standQuery/detailNew/exchange'): + global js_code_ym, fileContent + cookie = '' + response = httpx.post(getUrl) + content = response.text.split(' content="')[2].split('" r=')[0] + code1 = response.text.split('$_ts=window')[1].split('