1
1
import urllib3
2
2
import requests
3
3
import download
4
+ import asyncio
4
5
5
6
from launch import *
6
7
@@ -21,28 +22,31 @@ def __init__(self):
21
22
# 关闭urllib3不验证SSL产生的报错
22
23
urllib3 .disable_warnings ()
23
24
24
- # 检查更新
25
- version = "version_1.0.1"
25
+ async def async_init (self ):
26
+ # 检查更新
27
+ version = "version_1.0.1"
26
28
27
- check_update_url = f"https://api.ymbit.cn/public/check_update/{ version } .html"
28
- check_update = requests .get (check_update_url , verify = False )
29
+ check_update_url = (
30
+ f"https://api.ymbit.cn/public/check_update/{ version } .html"
31
+ )
32
+ check_update = requests .get (check_update_url , verify = False )
29
33
30
- if check_update .status_code == 200 :
31
- download .check_file_exists ()
32
- elif check_update .status_code == 404 :
33
- print ("目前 LoCyanPyLauncher 非最新版本,请前往 GitHub 更新。" )
34
- else :
35
- print ("检查更新失败,请检查网络连接。" )
36
- sys .exit (1 )
34
+ if check_update .status_code == 200 :
35
+ await download .check_frp_exists ()
36
+ elif check_update .status_code == 404 :
37
+ print ("目前 LoCyanPyLauncher 非最新版本,请前往 GitHub 更新。" )
38
+ else :
39
+ print ("检查更新失败,请检查网络连接。" )
40
+ sys .exit (1 )
37
41
38
- print ("欢迎使用LoCyan Frp Application" )
39
- result = self .r .get ("https://api.locyanfrp.cn/App" , verify = False )
40
- result = result .json ()
41
- contents = result ["contents" ]
42
- print ("------------------------------------------------" )
43
- print ("公告:" )
44
- print (contents )
45
- print ("------------------------------------------------" )
42
+ print ("欢迎使用LoCyan Frp Application" )
43
+ result = self .r .get ("https://api.locyanfrp.cn/App" , verify = False )
44
+ result = result .json ()
45
+ contents = result ["contents" ]
46
+ print ("------------------------------------------------" )
47
+ print ("公告:" )
48
+ print (contents )
49
+ print ("------------------------------------------------" )
46
50
47
51
def get_user_info (
48
52
self , node : str , code : str
0 commit comments