From f8857cbd176f722372cf21ffd7146e26edf40071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=85=89-k?= <36470587+kxgx@users.noreply.github.com> Date: Mon, 20 Jan 2025 18:20:54 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20weather.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/weather.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/weather.py b/bin/weather.py index 7be9624..722d1b0 100644 --- a/bin/weather.py +++ b/bin/weather.py @@ -63,7 +63,7 @@ def get_current_city(): def getWeath(city='101060101'): headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36', - 'Referer': 'http://www.weather.com.cn/' + 'Referer': 'https://www.weather.com.cn/' } current_city = get_current_city() if current_city: @@ -71,7 +71,7 @@ def getWeath(city='101060101'): if area_id: city = area_id try: - response = requests.get('http://d1.weather.com.cn/sk_2d/'+city+'.html',headers=headers) + response = requests.get('https://d1.weather.com.cn/sk_2d/'+city+'.html',headers=headers) response.raise_for_status() # 检查请求是否成功 response.encoding = 'utf-8' Weath = response.text[11:]