feat: 花里胡哨

This commit is contained in:
ikun
2024-09-17 14:53:08 +08:00
parent a821938f01
commit 8cefcae6a7
2 changed files with 13 additions and 9 deletions

View File

@@ -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')
log.warning('本项目完全开源免费如果你在淘宝QQ群内通过购买方式获得赶紧回去骂商家死全家\n交流群组:\nhttps://qm.qq.com/q/d7sWovfAGI\nhttps://t.me/ikunshare_group')

View File

@@ -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))