FongMi 5以上版本支持

This commit is contained in:
qist
2026-08-22 19:45:55 +08:00
parent 5fa096b348
commit 0ec63afd14
+11 -18
View File
@@ -40,24 +40,17 @@ class 文件加解密器:
encoded_netloc = quote(parsed.netloc, safe='') encoded_netloc = quote(parsed.netloc, safe='')
url = parsed._replace(netloc=encoded_netloc).geturl() url = parsed._replace(netloc=encoded_netloc).geturl()
# 优先通过 CF Worker 代理下载 req = Request(url, headers={
cf_proxy = 'https://wild-butterfly-88a5.juestnow.workers.dev' 'User-Agent': 'okhttp/3.12.0',
proxy_url = f"{cf_proxy}?q={url}" 'Accept-Encoding': 'gzip, deflate'
try: })
req = Request(proxy_url, headers={ with urlopen(req, timeout=30) as response:
'User-Agent': 'okhttp/3.12.0', raw_content = response.read()
'Accept-Encoding': 'gzip, deflate'
}) # 检查是否为图片或二进制文件
with urlopen(req, timeout=30) as response: content_type = response.headers.get('Content-Type', '')
raw_content = response.read() if content_type.startswith('image/') or content_type.startswith('video/') or content_type.startswith('audio/'):
except Exception as cf_err: print(f" 检测到{content_type}类型,尝试提取嵌入的数据...")
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()
# 检查文件头是否为常见图片格式 # 检查文件头是否为常见图片格式
image_headers = [ image_headers = [