From fe624d1a2d066b7700c512adf2433fed143d1ef1 Mon Sep 17 00:00:00 2001 From: frxz751113 <156018267+frxz751113@users.noreply.github.com> Date: Wed, 14 Aug 2024 23:25:17 +0800 Subject: [PATCH] =?UTF-8?q?Update=20iptv=E6=B5=81=E7=95=85=E5=BA=A6?= =?UTF-8?q?=E6=A3=80=E6=B5=8B.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- py/iptv流畅度检测.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/py/iptv流畅度检测.py b/py/iptv流畅度检测.py index e1d1232..d9a4a08 100644 --- a/py/iptv流畅度检测.py +++ b/py/iptv流畅度检测.py @@ -264,10 +264,14 @@ for url in valid_urls: name = name.replace("电视剧", "影视") name = name.replace("奥运匹克", "") results.append(f"{name},{urld}") - except: - continue - except: - continue + except requests.exceptions.HTTPError as e: + print(f"HTTPError occurred: {e}") + # 如果发生HTTPError异常,设置标志为False,跳过当前JSON文件的解析 + continue_parsing = False + except requests.exceptions.RequestException as e: + print(f"RequestException occurred: {e}") + # 如果发生其他请求异常,设置标志为False,跳过当前JSON文件的解析 + continue_parsing = False channels = [] for result in results: line = result.strip()