diff --git a/__init__.py b/__init__.py index ca69202..ce7aa9d 100644 --- a/__init__.py +++ b/__init__.py @@ -29,7 +29,7 @@ except: print(f"[WARN] ComfyUI-Manager: Your ComfyUI version is outdated. Please update to the latest version.") -version = [2, 5, 1] +version = [2, 5, 2] version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '') print(f"### Loading: ComfyUI-Manager ({version_str})") @@ -1833,37 +1833,32 @@ async def get_notice(request): url = "github.com" path = "/ltdrdata/ltdrdata.github.io/wiki/News" - conn = http.client.HTTPSConnection(url) - conn.request("GET", path) + async with aiohttp.ClientSession(trust_env=True, connector=aiohttp.TCPConnector(verify_ssl=False)) as session: + async with session.get(f"https://{url}{path}") as response: + if response.status == 200: + # html_content = response.read().decode('utf-8') + html_content = await response.text() - response = conn.getresponse() + pattern = re.compile(r'
([\s\S]*?)
') + match = pattern.search(html_content) - try: - if response.status == 200: - html_content = response.read().decode('utf-8') - - pattern = re.compile(r'
([\s\S]*?)
') - match = pattern.search(html_content) - - if match: - markdown_content = match.group(1) - markdown_content += f"
ComfyUI: {comfy_ui_revision}[{comfy_ui_hash[:6]}]({comfy_ui_commit_datetime.date()})" - # markdown_content += f"
         ()" - markdown_content += f"
Manager: {version_str}" + if match: + markdown_content = match.group(1) + markdown_content += f"
ComfyUI: {comfy_ui_revision}[{comfy_ui_hash[:6]}]({comfy_ui_commit_datetime.date()})" + # markdown_content += f"
         ()" + markdown_content += f"
Manager: {version_str}" - try: - if comfy_ui_required_commit_datetime.date() > comfy_ui_commit_datetime.date(): - markdown_content = f'

Your ComfyUI is too OUTDATED!!!

' + markdown_content - except: - pass + try: + if comfy_ui_required_commit_datetime.date() > comfy_ui_commit_datetime.date(): + markdown_content = f'

Your ComfyUI is too OUTDATED!!!

' + markdown_content + except: + pass - return web.Response(text=markdown_content, status=200) + return web.Response(text=markdown_content, status=200) + else: + return web.Response(text="Unable to retrieve Notice", status=200) else: return web.Response(text="Unable to retrieve Notice", status=200) - else: - return web.Response(text="Unable to retrieve Notice", status=200) - finally: - conn.close() @server.PromptServer.instance.routes.get("/manager/reboot")