Files
Ytong825-mao/砍手极速版.py
Ytong a7e1972456 0.0
2025-10-18 03:50:54 +08:00

159 lines
5.4 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import os
import urllib.request
import sys
import time
import platform
class SystemChecker:
@staticmethod
def is_arm_architecture():
"""检测是否为ARM架构"""
machine = platform.machine().lower()
arm_patterns = [
'arm', 'aarch', 'arm64', 'aarch64',
'armv7', 'armv8', 'armhf'
]
return any(pattern in machine for pattern in arm_patterns)
@staticmethod
def is_amd_architecture():
"""检测是否为AMD/x86架构"""
machine = platform.machine().lower()
amd_patterns = [
'x86_64', 'amd64', 'x86', 'i386', 'i686',
'amd', 'intel', 'x64'
]
return any(pattern in machine for pattern in amd_patterns)
@staticmethod
def is_supported_architecture():
"""检测是否支持ARM或AMD架构"""
return SystemChecker.is_arm_architecture() or SystemChecker.is_amd_architecture()
@staticmethod
def is_linux_supported():
"""检测是否为Linux且支持ARM或AMD架构"""
return SystemChecker.is_supported_architecture()
@staticmethod
def get_architecture_type():
"""获取具体的架构类型"""
if SystemChecker.is_arm_architecture():
return 'arm'
elif SystemChecker.is_amd_architecture():
return 'amd'
else:
return 'unknown'
@staticmethod
def get_detailed_info():
return {
'os': platform.system(),
'architecture': platform.machine(),
'arch_type': SystemChecker.get_architecture_type()
}
checker = SystemChecker()
if checker.is_linux_supported():
pass
else:
info = checker.get_detailed_info()
print(f'当前系统不支持,当前系统类型: {info["os"]},系统架构: {info["architecture"]}')
exit(1)
def get_architecture():
"""获取系统架构"""
arch = platform.machine().lower()
if 'arm' in arch or 'aarch' in arch:
return 'arm'
elif 'x86' in arch or 'amd' in arch or 'i386' in arch or 'i686' in arch:
return 'amd'
else:
return arch
current_arch = get_architecture()
####################使用教程区####################
#广告类型1为饭补 2为看广告3为宝箱广告4为200广(已单独剔出),其他值为以上全部执行,默认全部执行
# 抓包 ck和salt
# 格式1备注#Cookie#salt#广告类型(备注#Cookie#salt#1,2)
# 格式2备注#Cookie#salt#广告类型#sock5
#广告类型为列表模式,使用英文逗号隔开,填什么就指定跑什么
# socks5存在则使用代理反之
# socks代理选择参数可填可不填 格式ip|port|username|password
# ck变量ksjsbck, 填写上面两种格式ck均可多号新建变量即可
# 并发变量KS_BF, 设置为False为关闭并发默认开启
# 卡密变量KS_Card 填写购买的卡密即可
# 金币自动兑换变量KS_JBDH 默认关闭True开启
# 自动提现变量KS_TX 默认关闭True开启
# 运行延迟变量KS_YC 默认30,45格式为【最低,最高】,中间英文逗号隔开
# 运行次数变量KS_YXCS 默认999
# 金币控制变量KS_JBMAX 默认500000
# 广告模式变量KS_ADMS 默认为1(正常广告)设置2为追加(理论默认即可)
# 自动更换did变量KS_DID 默认关闭True开启(实测不好用)
# 自动更换did金币数量变量KS_JBSU 低于多少尝试更换did默认900自动更换开启生效
def GET_SO():
PythonV = sys.version_info
if PythonV.major == 3 and PythonV.minor == 10:
PythonV = '10'
print('当前Python版本为3.10 开始安装...')
elif PythonV.major == 3 and PythonV.minor == 11:
PythonV = '11'
print('当前Python版本为3.11 开始安装...')
else:
return False, f'不支持的Python版本{sys.version}'
try:
mirrors = [
f'https://raw.bgithub.xyz/BIGOSTK/pyso/refs/heads/main/ksad_{current_arch}_{PythonV}.so',
f'https://gh-proxy.com/https://raw.githubusercontent.com/BIGOSTK/pyso/main/ksad_{current_arch}_{PythonV}.so',
f'https://raw.githubusercontent.com/BIGOSTK/pyso/main/ksad_{current_arch}_{PythonV}.so',
f'https://raw.bgithub.xyz/BIGOSTK/pyso/main/ksad_{current_arch}_{PythonV}.so'
]
last_error = None
for url in mirrors:
try:
print(f'尝试从 {url} 下载...')
with urllib.request.urlopen(url, timeout=15) as response:
if response.status == 200:
with open('./ksad.so', 'wb') as out_file:
out_file.write(response.read())
print('下载成功')
return True, None
except Exception as e:
last_error = e
print(f'下载失败: {e}')
time.sleep(1)
return False, f'所有镜像尝试失败: {last_error}'
except Exception as e:
return False, e
def main():
if not os.path.exists('./ksad.so'):
success, error = GET_SO()
if not success:
print(f'无法获取ksad.so: {error}')
return
try:
import ksad
ksad.main()
except ImportError as e:
print(f'导入ksad模块失败: {e}')
except Exception as e:
print(f'执行ksad.main()时出错: {e}')
if __name__ == '__main__':
main()