diff --git a/datasource/crypto.py b/datasource/crypto.py index ed7546b..bf3ebde 100644 --- a/datasource/crypto.py +++ b/datasource/crypto.py @@ -26,7 +26,8 @@ def _get_top_coins_by_market_cap(top): # 获取Binance上的USDT交易对信息 def _get_binance_usdt_pairs(): url = "https://api.binance.com/api/v3/exchangeInfo" - response = requests.get(url) + urllib3.disable_warnings(category=urllib3.exceptions.InsecureRequestWarning) + response = requests.get(url, verify=False) data = response.json() usdt_pairs = [symbol['symbol'] for symbol in data['symbols'] if (symbol['quoteAsset'] == 'USDT' and symbol['status'] == 'TRADING')] diff --git a/telegram_sender.py b/telegram_sender.py index 9ca5dfd..28fd467 100644 --- a/telegram_sender.py +++ b/telegram_sender.py @@ -1,5 +1,6 @@ import requests import setting +import urllib3 # 发送消息 def send_message(chat_id, text): @@ -8,4 +9,5 @@ def send_message(chat_id, text): "chat_id" : chat_id, "text" : text } - requests.post(url, data= formData) \ No newline at end of file + urllib3.disable_warnings(category=urllib3.exceptions.InsecureRequestWarning) + requests.post(url, data= formData, verify=False) \ No newline at end of file