Compare commits

..

5 Commits

Author SHA1 Message Date
ikun0014
7135e13fd7 更新 build.yml 2024-10-11 20:12:30 +08:00
ikun0014
b87867088b 1.2.5 2024-10-11 20:05:01 +08:00
ikun0014
fc03979107 chore: 丝滑刷版本号测试 2024-10-11 20:04:42 +08:00
dependabot[bot]
eb1501a43a Merge pull request #42 from ikunshare/dependabot/pip/aiohttp-3.10.2 2024-10-01 14:10:32 +00:00
dependabot[bot]
ea3b682eb7 build(deps): bump aiohttp from 3.9.5 to 3.10.2
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.5 to 3.10.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.9.5...v3.10.2)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-01 13:57:35 +00:00
13 changed files with 45 additions and 16 deletions

View File

@@ -7,6 +7,8 @@ on:
jobs:
build:
permissions:
contents: write
runs-on: windows-2019
steps:
- name: Check out git repository
@@ -70,3 +72,18 @@ jobs:
build/Onekey---v${{ env.PACKAGE_VERSION }}.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to Telegram Channel
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
${{ github.actor }} created commit:
Commit message: ${{ github.event.commits[0].message }}
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
document: |
build/Onekey---v${{ env.PACKAGE_VERSION }}.exe

View File

@@ -28,7 +28,7 @@ async def gen_config_file():
log.info('🖱️ 程序可能为第一次启动或配置重置,请填写配置文件后重新启动程序')
except Exception as e:
log.error(f' 配置文件生成失败,{stack_error(e)}')
log.error(f' 配置文件生成失败,{stack_error(e)}')
async def load_config():
if not os.path.exists('./config.json'):

View File

@@ -36,5 +36,5 @@ async def depotkey_merge(config_path: Path, depots_config: dict) -> bool:
except Exception as e:
async with lock:
log.error(f' 合并失败,原因: {e}')
log.error(f' 合并失败,原因: {e}')
return False

View File

@@ -37,7 +37,7 @@ async def get_manifest(sha: str, path: str, steam_path: Path, repo: str, session
]
except Exception as e:
log.error(f' 处理失败: {path} - {stack_error(e)}')
log.error(f' 处理失败: {path} - {stack_error(e)}')
raise
return collected_depots

View File

@@ -13,7 +13,7 @@ def get_steam_path() -> Path:
custom_steam_path = config.get("Custom_Steam_Path", "").strip()
return Path(custom_steam_path) if custom_steam_path else steam_path
except Exception as e:
log.error(f'Steam路径获取失败, {stack_error(e)}')
log.error(f'Steam路径获取失败, {stack_error(e)}, 请检查是否正确安装Steam')
os.system('pause')
return Path()

View File

@@ -28,5 +28,5 @@ async def greenluma_add(depot_id_list: list) -> bool:
return True
except Exception as e:
print(f' 处理时出错: {e}')
print(f' 处理时出错: {e}')
return False

View File

@@ -18,7 +18,7 @@ def init():
log.info('作者ikun0014')
log.info('本项目采用GNU General Public License v3开源许可证')
log.info('版本1.2.4')
log.info('版本1.2.5')
log.info('项目仓库https://github.com/ikunshare/Onekey')
log.info('官网ikunshare.com')
log.warning('本项目完全开源免费如果你在淘宝QQ群内通过购买方式获得赶紧回去骂商家死全家\n交流群组:\nhttps://qm.qq.com/q/d7sWovfAGI\nhttps://t.me/ikunshare_group')
log.warning('本项目完全开源免费如果你在淘宝QQ群内通过购买方式获得赶紧回去骂商家死全家\n交流群组:\nhttps://qm.qq.com/q/d7sWovfAGI\nhttps://t.me/ikunshare_qun')

View File

@@ -1,6 +1,5 @@
from aiohttp import ClientError, ClientResponse
from aiohttp import ClientError
from tqdm.asyncio import tqdm_asyncio
from typing import Union
from .log import log
@@ -37,7 +36,7 @@ async def get(sha: str, path: str, repo: str, session, chunk_size: int = 1024) -
total_size = int(response.headers.get('Content-Length', 0))
content = bytearray()
with tqdm_asyncio(total=total_size, unit='B', unit_scale=True, desc=f'下载 {path}', colour='#ffadad') as pbar:
with tqdm_asyncio(total=total_size, unit='B', unit_scale=True, desc=f'🔄 下载 {path}', colour='#ffadad') as pbar:
async for chunk in response.content.iter_chunked(chunk_size):
content.extend(chunk)
pbar.update(len(chunk))

View File

@@ -1,4 +1,3 @@
import os
import subprocess
import aiofiles
from pathlib import Path

View File

@@ -34,7 +34,7 @@ async def stool_add(depot_data: list, app_id: str) -> bool:
log.info('✅ 处理完成')
except Exception as e:
log.error(f' 处理过程出现错误: {e}')
log.error(f' 处理过程出现错误: {e}')
return False
finally:
if lua_filepath.exists():

18
main.py
View File

@@ -1,8 +1,7 @@
import os
import time
import sys
import asyncio
import re
import platform
from colorama import Fore, Back, Style
from colorama import init as cinit
@@ -22,6 +21,20 @@ repos = [
'tymolu233/ManifestAutoUpdate',
]
def check_system_msg():
os_type = platform.system()
try:
if not os_type == 'Windows':
log.error(f'❌ 不用Windows你想上天{os_type}')
except Exception as e:
log.error(f'❌ 获取系统类型失败:{stack_error(e)}')
os_version = sys.getwindowsversion().major
try:
if os_version < 10:
log.error(f'❌ 低于Windows10就别用了买台新电脑吧当前版本Windows {os_version}')
except Exception as e:
log.error(f'❌ 获取系统版本失败:{stack_error(e)}')
def prompt_app_id():
app_id = input(f"{Fore.CYAN}{Back.BLACK}{Style.BRIGHT}🤔 请输入游戏AppID{Style.RESET_ALL}").strip()
if re.match(r'^\d+$', app_id):
@@ -51,6 +64,7 @@ async def run():
if __name__ == '__main__':
try:
check_system_msg()
asyncio.run(run())
except SystemExit:
sys.exit()

View File

@@ -1,6 +1,6 @@
{
"name": "onekey",
"version": "1.2.4",
"version": "1.2.5",
"description": "一个Steam仓库清单下载器",
"main": "index.js",
"scripts": {

View File

@@ -1,5 +1,5 @@
aiofiles==24.1.0
aiohttp==3.9.5
aiohttp==3.10.2
colorama==0.4.6
colorlog==6.8.2
tqdm==4.66.5