liuyuqi-dellpc 1 month ago
parent
commit
f10fd7582a
2 changed files with 17 additions and 4 deletions
  1. 4 4
      client.py
  2. 13 0
      docs/fgh_host.json

+ 4 - 4
client.py

@@ -38,12 +38,12 @@ fgh curl -O https://ghproxy.org/https://raw.githubusercontent.com/microsoft/vsco
     def __init__(self):
         self.fgit_host = ''
         self.token = ''
+        self.sess = requests.Session()
+        self.env_file_path = os.path.join(get_app_path(), '.env')
         self.update_host()
         self.read_config()
         self.args = self.parse_args()
-        self.sess = requests.Session()
-        self.env_file_path = os.path.join(get_app_path(), '.env')
-
+        
     def read_config(self):
         """ read config """
         current_dir = get_app_path()
@@ -93,7 +93,7 @@ fgh curl -O https://ghproxy.org/https://raw.githubusercontent.com/microsoft/vsco
         """update host"""
         res = []
         try:
-            res = self.sess.get(self.fgit_host+'/update_host')
+            res = self.sess.get('https://git.yoqi.me/lyq/fgh/raw/master/docs/fgh_host.json')
             fgh_hosts= res.json()["hosts"]
             fgh_host= self._get_best_host()
             dotenv.set_key(self.env_file_path, 'FGH_HOST', fgh_host)

+ 13 - 0
docs/fgh_host.json

@@ -0,0 +1,13 @@
+{
+    "code": 200,
+    "hosts": [
+        "https://ghproxy.org/",
+        "https://mirror.ghproxy.com/",
+        "https://gh-proxy.llyke.com/",
+        "https://gh.noki.icu/",
+        "https://gh.cache.cloudns.org/",
+        "https://ghproxy.cc/",
+        "https://gh.sixyin.com",
+        "https://ghproxy.friendsa.onflashdrive.app/"
+    ]
+}