From 3ec8cc3974e7ce84224294610072010ea188ef7b Mon Sep 17 00:00:00 2001 From: ayoayco Date: Sun, 7 Jul 2024 12:39:37 +0200 Subject: [PATCH] fix: on a mac, aiohttp causes failure due to strict SSL checks - set ssl to False; see: https://docs.aiohttp.org/en/stable/client_advanced.html#ssl-control-for-tcp-sockets --- threads.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/threads.py b/threads.py index 8cc0cad..77d7d70 100755 --- a/threads.py +++ b/threads.py @@ -1,6 +1,5 @@ from flask import Blueprint, render_template, current_app import requests -import json from datetime import datetime import markdown import re @@ -80,11 +79,12 @@ def api_thread(id): async def get(url, session): try: - async with session.get(url=url) as response: + async with session.get(url, ssl=False) as response: res = await response.json() return clean_status(res) except Exception as e: print(f"Unable to get url {url} due to {e.__class__}") + return {} def get_status_url(ser, id): return f'{ser}/api/v1/statuses/{id}'