mirror of
https://github.com/ikunshare/Onekey.git
synced 2026-01-12 16:25:53 +08:00
详细一点的日志
This commit is contained in:
@@ -66,7 +66,7 @@ pip install -r requirements.txt
|
||||
</a>
|
||||
|
||||
## 常见问题解答(FAQ)
|
||||
查看 [FAQ](https://ikunshare.com/d/49) 获取常见问题的解答。
|
||||
查看 [FAQ](https://ikunshare.top/d/49) 获取常见问题的解答。
|
||||
|
||||
## 社区和支持
|
||||
加入我们的社区,参与讨论和支持:
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
import os
|
||||
import colorama
|
||||
import logging
|
||||
import logzero
|
||||
from logzero import setup_logger, LogFormatter
|
||||
from .variable import LOG_FILE, DEBUG_MODE
|
||||
try:
|
||||
import os
|
||||
import colorama
|
||||
import logging
|
||||
import logzero
|
||||
from logzero import setup_logger, LogFormatter
|
||||
from .variable import LOG_FILE, DEBUG_MODE
|
||||
except ImportError as e:
|
||||
print(e)
|
||||
import os
|
||||
|
||||
os.system("pause")
|
||||
|
||||
if not os.path.exists(f"./logs"):
|
||||
os.makedirs(f"./logs")
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
import time
|
||||
import httpx
|
||||
import sys
|
||||
import winreg
|
||||
import ujson as json
|
||||
from pathlib import Path
|
||||
try:
|
||||
import time
|
||||
import httpx
|
||||
import sys
|
||||
import winreg
|
||||
import ujson as json
|
||||
from pathlib import Path
|
||||
except ImportError as e:
|
||||
print(e)
|
||||
import os
|
||||
|
||||
os.system("pause")
|
||||
|
||||
|
||||
def get_steam_path(config: dict) -> Path:
|
||||
|
||||
52
main.py
52
main.py
@@ -1,22 +1,28 @@
|
||||
import os
|
||||
import sys
|
||||
try:
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
import vdf
|
||||
import time
|
||||
import httpx
|
||||
import asyncio
|
||||
import traceback
|
||||
from typing import Any, Tuple, List, Dict
|
||||
from pathlib import Path
|
||||
from common import log, variable
|
||||
from common.variable import (
|
||||
CLIENT,
|
||||
HEADER,
|
||||
STEAM_PATH,
|
||||
REPO_LIST,
|
||||
)
|
||||
import vdf
|
||||
import time
|
||||
import httpx
|
||||
import asyncio
|
||||
import traceback
|
||||
from typing import Any, Tuple, List, Dict
|
||||
from pathlib import Path
|
||||
from common import log, variable
|
||||
from common.variable import (
|
||||
CLIENT,
|
||||
HEADER,
|
||||
STEAM_PATH,
|
||||
REPO_LIST,
|
||||
)
|
||||
except ImportError as e:
|
||||
import os
|
||||
|
||||
print(e)
|
||||
os.system("pause")
|
||||
|
||||
|
||||
LOCK = asyncio.Lock()
|
||||
@@ -35,9 +41,9 @@ def init() -> None:
|
||||
\_____/ |_| \_| |_____| |_| \_\ |_____| /_/
|
||||
"""
|
||||
LOG.info(banner)
|
||||
LOG.info("作者: ikun0014 | 版本: 1.4.7 | 官网: ikunshare.com")
|
||||
LOG.info("作者: ikun0014 | 版本: 1.4.8 | 官网: ikunshare.top")
|
||||
LOG.info("项目仓库: GitHub: https://github.com/ikunshare/Onekey")
|
||||
LOG.warning("ikunshare.com | 严禁倒卖")
|
||||
LOG.warning("ikunshare.top | 严禁倒卖")
|
||||
LOG.warning("提示: 请确保已安装Windows 10/11并正确配置Steam;SteamTools/GreenLuma")
|
||||
LOG.warning("开梯子必须配置Token, 你的IP我不相信能干净到哪")
|
||||
|
||||
@@ -137,7 +143,7 @@ async def HandleDepotFiles(
|
||||
tree_res = await CLIENT.get(tree_url)
|
||||
tree_res.raise_for_status()
|
||||
|
||||
depot_cache = steam_path / "depotcache"
|
||||
depot_cache = Path(f"{steam_path}/depotcache")
|
||||
depot_cache.mkdir(exist_ok=True)
|
||||
|
||||
LOG.info(f"当前选择清单仓库: https://github.com/{selected_repo}")
|
||||
@@ -246,7 +252,7 @@ def SetupUnlock(
|
||||
|
||||
|
||||
def SetupTools(depot_data: List[Tuple[str, str]], app_id: str, depot_map: Dict) -> bool:
|
||||
st_path = STEAM_PATH / "config" / "stplug-in"
|
||||
st_path = Path(f"{STEAM_PATH}/config/stplug-in")
|
||||
st_path.mkdir(exist_ok=True)
|
||||
|
||||
choice = input(
|
||||
@@ -274,7 +280,7 @@ def SetupTools(depot_data: List[Tuple[str, str]], app_id: str, depot_map: Dict)
|
||||
|
||||
|
||||
def SetupGreenLuma(depot_data: List[Tuple[str, str]]) -> bool:
|
||||
applist_dir = STEAM_PATH / "AppList"
|
||||
applist_dir = Path(f"{STEAM_PATH}/AppList")
|
||||
applist_dir.mkdir(exist_ok=True)
|
||||
|
||||
for f in applist_dir.glob("*.txt"):
|
||||
@@ -283,7 +289,7 @@ def SetupGreenLuma(depot_data: List[Tuple[str, str]]) -> bool:
|
||||
for idx, (d_id, _) in enumerate(depot_data, 1):
|
||||
(applist_dir / f"{idx}.txt").write_text(str(d_id))
|
||||
|
||||
config_path = STEAM_PATH / "config" / "config.vdf"
|
||||
config_path = Path(f"{STEAM_PATH}/config/config.vdf")
|
||||
with open(config_path, "r+") as f:
|
||||
content = vdf.loads(f.read())
|
||||
content.setdefault("depots", {}).update(
|
||||
|
||||
Reference in New Issue
Block a user