Преглед на файлове

七日天气更新为v1线路

林轩 преди 1 година
родител
ревизия
f5c5f6729d
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 2 2
      crond_script/server_weather.py
  2. 1 1
      crond_script/today_weather.py

+ 2 - 2
crond_script/server_weather.py

@@ -78,7 +78,7 @@ def main():
     for server_day_obj in server_days:
         time_out_k = False 
         print(server_day_obj.cityid)
-        server_day_url = f"http://v0.yiketianqi.com/api?unescape=1&version=v91&appid=69334222&appsecret=2ME6U58N&cityid={server_day_obj.cityid}&ext=hours,aqi,life"
+        server_day_url = f"http://v1.yiketianqi.com/api?unescape=1&version=v91&appid=69334222&appsecret=2ME6U58N&cityid={server_day_obj.cityid}&ext=hours,aqi,life"
         server_day_response = requests.get(server_day_url, headers=headers, timeout=10)
         server_ct += 1
         try:
@@ -111,7 +111,7 @@ def main():
         else:
             time.sleep(2)
     with open("/data/weather/weather_count.txt", 'a+', encoding='utf-8') as f:
-        f.write(f"开始时间:{server_start_ct_time}  结束时间:{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} 调用次数:{server_ct}")
+        f.write(f"开始时间:{server_start_ct_time}  结束时间:{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} 调用次数:{server_ct}  \n")
 
 
 if __name__ == "__main__":

+ 1 - 1
crond_script/today_weather.py

@@ -126,7 +126,7 @@ def main():
         else:
             time.sleep(2)
     with open("/data/weather/weather_count.txt", 'a+', encoding='utf-8') as f:
-        f.write(f"开始时间:{start_ct_time}  结束时间:{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} 调用次数:{day_ct}")
+        f.write(f"开始时间:{start_ct_time}  结束时间:{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} 调用次数:{day_ct} \n")
 
 
 if __name__ == "__main__":