Compare commits

...

4 Commits
1.1.0 ... 1.1.2

Author SHA1 Message Date
ikun
a2fa038324 feat&&fix: bug!bug!bug! 2024-08-22 22:40:50 +08:00
ikun
ea3aedbab3 fix: 史 2024-08-22 21:48:04 +08:00
ikun
51ccc579f4 feat:配置文件修改 2024-08-22 14:10:30 +08:00
ikun
17e654a68e feat:没什么用懒得发Release 2024-08-21 17:27:50 +08:00

41
main.py
View File

@@ -7,7 +7,7 @@ import traceback
import subprocess
import colorlog
import logging
import json
import ujson as json
import time
import sys
import psutil
@@ -37,9 +37,16 @@ def init_log():
# 生成配置文件
def gen_config_file():
default_config = {"Github_Persoal_Token": "", "Custom_Steam_Path": ""}
with open('./config.json', 'w', encoding='utf-8') as f:
json.dump(default_config, f)
default_config ={
"Github_Personal_Token": "",
"Custom_Steam_Path": "",
"QA1": "温馨提示Github_Personal_Token可在Github设置的最底下开发者选项找到详情看教程",
"教程": "https://lyvx-my.sharepoint.com/:w:/g/personal/ikun_ikunshare_com/EWqIqyCElLNLo_CKfLbqix0BWU_O03HLzEHQKHdJYrUz-Q?e=79MZjw"
}
with open("./config.json", "w", encoding="utf-8") as f:
f.write(json.dumps(default_config, indent=2, ensure_ascii=False,
escape_forward_slashes=False))
f.close()
log.info(' 🖱️ 程序可能为第一次启动,请填写配置文件后重新启动程序')
@@ -50,8 +57,8 @@ def load_config():
os.system('pause')
sys.exit()
else:
with open('./config.json', 'r', encoding='utf-8') as f:
config = json.load(f)
with open("./config.json", "r", encoding="utf-8") as f:
config = json.loads(f.read())
return config
@@ -68,7 +75,7 @@ print('\033[1;32;40m | |_| | | | \\ | | |___ | | \\ \\ | |___ / /' + '\033
print('\033[1;32;40m \\_____/ |_| \\_| |_____| |_| \\_\\ |_____| /_/' + '\033[0m')
log.info('作者ikun0014')
log.info('本项目基于wxy1343/ManifestAutoUpdate进行修改采用GPL V3许可证')
log.info('版本1.1.0')
log.info('版本1.1.2')
log.info('项目仓库https://github.com/ikunshare/Onekey')
log.debug('官网ikunshare.com')
log.warning('本项目完全开源免费如果你在淘宝QQ群内通过购买方式获得赶紧回去骂商家死全家\n交流群组:\n点击链接加入群聊【𝗶𝗸𝘂𝗻分享】https://qm.qq.com/q/d7sWovfAGI\nhttps://t.me/ikunshare_group')
@@ -99,7 +106,9 @@ def stack_error(exception):
# 下载清单
async def get(sha, path, repo, session):
url_list = [
f'https://gh.api.99988866.xyz/https://raw.githubusercontent.com/{repo}/{sha}/{path}',
# f'https://gh.api.99988866.xyz/https://raw.githubusercontent.com/{repo}/{sha}/{path}',
f'https://cdn.jsdmirror.com/gh/{repo}@{sha}/{path}',
f'https://jsd.onmicrosoft.cn/gh/{repo}@{sha}/{path}',
f'https://mirror.ghproxy.com/https://raw.githubusercontent.com/{repo}/{sha}/{path}',
f'https://raw.githubusercontent.com/{repo}/{sha}/{path}',
f'https://gh.jiasu.in/https://raw.githubusercontent.com/{repo}/{sha}/{path}'
@@ -189,7 +198,7 @@ async def stool_add(depot_data, app_id):
# 增加GreenLuma解锁相关文件
async def greenluma_add(depot_id_list):
app_list_path = steam_path / 'appcache' / 'appinfo.vdf'
app_list_path = steam_path / 'AppList'
if app_list_path.exists() and app_list_path.is_file():
app_list_path.unlink(missing_ok=True)
if not app_list_path.is_dir():
@@ -229,7 +238,11 @@ async def check_github_api_rate_limit(headers, session):
url = 'https://api.github.com/rate_limit'
async with session.get(url, headers=headers, ssl=False) as r:
r_json = await r.json()
if not r == None:
r_json = await r.json()
else:
log.error('孩子,你怎么做到的?')
os.system('pause')
if r.status == 200:
rate_limit = r_json['rate']
@@ -245,7 +258,7 @@ async def check_github_api_rate_limit(headers, session):
# 主函数
async def main(app_id):
async with ClientSession() as session:
github_token = config.get("Github_Persoal_Token", "")
github_token = config.get("Github_Personal_Token", "")
headers = {'Authorization': f'Bearer {github_token}'} if github_token else None
latest_date = None
selected_repo = None
@@ -288,7 +301,7 @@ async def main(app_id):
if isGreenLuma:
await greenluma_add([app_id])
depot_config = {'depots': {depot_id: {'DecryptionKey': depot_key} for depot_id, depot_key in collected_depots}}
depotkey_merge(steam_path / 'config' / 'config.vdf', depot_config)
await depotkey_merge(steam_path / 'config' / 'config.vdf', depot_config)
if await greenluma_add([int(i) for i in depot_config['depots'] if i.isdecimal()]):
log.info(' ✅ 找到GreenLuma已添加解锁文件')
log.info(f' ✅ 清单最后更新时间:{date}')
@@ -303,7 +316,9 @@ parser.add_argument('-a', '--app-id')
args = parser.parse_args()
repos = [
'ManifestHub/ManifestHub',
'ikun0014/ManifestHub'
'ikun0014/ManifestHub',
'Auiowu/ManifestAutoUpdate',
'tymolu233/ManifestAutoUpdate'
]
if __name__ == '__main__':
try: