From 8cefcae6a73b8070d017e01f4f8149a59a61e53c Mon Sep 17 00:00:00 2001 From: ikun Date: Tue, 17 Sep 2024 14:53:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=8A=B1=E9=87=8C=E8=83=A1=E5=93=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/init_text.py | 18 +++++++++++------- common/manifest_down.py | 4 ++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/common/init_text.py b/common/init_text.py index 04f34e2..e9584f6 100644 --- a/common/init_text.py +++ b/common/init_text.py @@ -1,15 +1,19 @@ +from colorama import Fore, Back, Style, init + +init() + from .log import log def init(): - print('\033[1;32;40m _____ __ _ _____ _ _ _____ __ __ ' + '\033[0m') - print('\033[1;32;40m / _ \\ | \\ | | | ____| | | / / | ____| \\ \\ / /' + '\033[0m') - print('\033[1;32;40m | | | | | \\| | | |__ | |/ / | |__ \\ \\/ /' + '\033[0m') - print('\033[1;32;40m | | | | | |\\ | | __| | |\\ \\ | __| \\ / ' + '\033[0m') - print('\033[1;32;40m | |_| | | | \\ | | |___ | | \\ \\ | |___ / /' + '\033[0m') - print('\033[1;32;40m \\_____/ |_| \\_| |_____| |_| \\_\\ |_____| /_/' + '\033[0m') + print(f"{Fore.GREEN}{Back.BLACK}{Style.BRIGHT} _____ __ _ _____ _ _ _____ __ __ {Style.RESET_ALL}") + print(f"{Fore.GREEN}{Back.BLACK}{Style.BRIGHT} / _ \\ | \\ | | | ____| | | / / | ____| \\ \\ / /{Style.RESET_ALL}") + print(f"{Fore.GREEN}{Back.BLACK}{Style.BRIGHT} | | | | | \\| | | |__ | |/ / | |__ \\ \\/ /{Style.RESET_ALL}") + print(f"{Fore.GREEN}{Back.BLACK}{Style.BRIGHT} | | | | | |\\ | | __| | |\\ \\ | __| \\ / {Style.RESET_ALL}") + print(f"{Fore.GREEN}{Back.BLACK}{Style.BRIGHT} | |_| | | | \\ | | |___ | | \\ \\ | |___ / /{Style.RESET_ALL}") + print(f"{Fore.GREEN}{Back.BLACK}{Style.BRIGHT} \\_____/ |_| \\_| |_____| |_| \\_\\ |_____| /_/{Style.RESET_ALL}") log.info('作者ikun0014') log.info('本项目采用GNU General Public License v3开源许可证') log.info('版本:1.2.1') 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') \ No newline at end of file + log.warning('本项目完全开源免费,如果你在淘宝,QQ群内通过购买方式获得,赶紧回去骂商家死全家\n交流群组:\nhttps://qm.qq.com/q/d7sWovfAGI\nhttps://t.me/ikunshare_group') diff --git a/common/manifest_down.py b/common/manifest_down.py index 1b098f7..32acbfa 100644 --- a/common/manifest_down.py +++ b/common/manifest_down.py @@ -8,7 +8,7 @@ async def get(sha, path, repo, session): url_list = [ 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://mirror.ghproxy.com/https://raw.githubusercontent.com/{repo}/{sha}/{path}', f'https://raw.githubusercontent.com/{repo}/{sha}/{path}', ] retry = 3 @@ -21,7 +21,7 @@ async def get(sha, path, repo, session): chunk_size = 1024 content = bytearray() - with tqdm_asyncio(total=total_size, unit='B', unit_scale=True, desc=f'下载 {path}') as pbar: + with tqdm_asyncio(total=total_size, unit='B', unit_scale=True, desc=f'下载 {path}', colour='#ffadad') as pbar: async for chunk in r.content.iter_chunked(chunk_size): content.extend(chunk) pbar.update(len(chunk))