From 0ec63afd14dd4d7f66d291f3231b5e03c2ef583f Mon Sep 17 00:00:00 2001 From: qist <87984115@qq.com> Date: Sat, 22 Aug 2026 19:45:55 +0800 Subject: [PATCH] =?UTF-8?q?FongMi=205=E4=BB=A5=E4=B8=8A=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/tvbox.py | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/tools/tvbox.py b/tools/tvbox.py index 749ded54..75fa3c5f 100644 --- a/tools/tvbox.py +++ b/tools/tvbox.py @@ -40,24 +40,17 @@ class 文件加解密器: encoded_netloc = quote(parsed.netloc, safe='') url = parsed._replace(netloc=encoded_netloc).geturl() - # 优先通过 CF Worker 代理下载 - cf_proxy = 'https://wild-butterfly-88a5.juestnow.workers.dev' - proxy_url = f"{cf_proxy}?q={url}" - try: - req = Request(proxy_url, headers={ - 'User-Agent': 'okhttp/3.12.0', - 'Accept-Encoding': 'gzip, deflate' - }) - with urlopen(req, timeout=30) as response: - raw_content = response.read() - except Exception as cf_err: - print(f" CF代理失败,尝试直连: {cf_err}") - req = Request(url, headers={ - 'User-Agent': 'okhttp/3.12.0', - 'Accept-Encoding': 'gzip, deflate' - }) - with urlopen(req, timeout=30) as response: - raw_content = response.read() + req = Request(url, headers={ + 'User-Agent': 'okhttp/3.12.0', + 'Accept-Encoding': 'gzip, deflate' + }) + with urlopen(req, timeout=30) as response: + raw_content = response.read() + + # 检查是否为图片或二进制文件 + content_type = response.headers.get('Content-Type', '') + if content_type.startswith('image/') or content_type.startswith('video/') or content_type.startswith('audio/'): + print(f" 检测到{content_type}类型,尝试提取嵌入的数据...") # 检查文件头是否为常见图片格式 image_headers = [