Merge pull request #45 from muwenyan521/main

feat:优化代码&更清晰的图标
This commit is contained in:
ikun0014
2024-10-13 22:13:23 +08:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -6,17 +6,19 @@ from .stack_error import stack_error
def checkcn():
try:
req = requests.get('https://mips.kugou.com/check/iscn?&format=json')
req.raise_for_status()
body = req.json()
scn = bool(body['flag'])
if (not scn):
if not scn:
log.info(f"您在非中国大陆地区({body['country']})上使用了项目, 已自动切换回Github官方下载CDN")
os.environ['IS_CN'] = 'no'
return False
else:
os.environ['IS_CN'] = 'yes'
return True
except Exception as e:
except requests.RequestException as e:
os.environ['IS_CN'] = 'yes'
log.warning('❗ 检查服务器位置失败,已忽略,自动认为你在中国大陆')
log.warning(stack_error(e))
return False
return False

BIN
icon.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 262 KiB