李莎 2 yıl önce
ebeveyn
işleme
fbc0f089f9
1 değiştirilmiş dosya ile 21 ekleme ve 10 silme
  1. 21 10
      main.py

+ 21 - 10
main.py

@@ -1,5 +1,6 @@
 import json
 import time
+import os
 
 from Utils.Hik_iSecure import Hik_iSecure
 from Utils.Hik_Cloud import Hik_Cloud
@@ -8,16 +9,26 @@ def datetime_now():
     datetimenow = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
     return datetimenow
 
-with open("config.json") as f:
-    f_data = json.load(f)
-    host = f_data["host"]
-    appKey = f_data["appKey"]
-    appSecret = f_data["appSecret"]
-    hik_host = f_data["hik_host"]
-    hik_client_id = f_data["hik_client_id"]
-    hik_client_secret = f_data["hik_client_secret"]
-    groupId = f_data["groupId"]
-    sleeptime = f_data["sleeptime"]
+# with open("config.json") as f:
+#     f_data = json.load(f)
+#     host = f_data["host"]
+#     appKey = f_data["appKey"]
+#     appSecret = f_data["appSecret"]
+#     hik_host = f_data["hik_host"]
+#     hik_client_id = f_data["hik_client_id"]
+#     hik_client_secret = f_data["hik_client_secret"]
+#     groupId = f_data["groupId"]
+#     sleeptime = f_data["sleeptime"]
+
+host = os.getenv("host")
+appKey = os.getenv("appKey")
+appSecret = os.getenv("appSecret")
+hik_host = os.getenv("hik_host")
+hik_client_id = os.getenv("hik_client_id")
+hik_client_secret = os.getenv("hik_client_secret")
+groupId = os.getenv("groupId")
+sleeptime = os.getenv("sleeptime")
+
 
 
 while True: