From 0c37dbc8a699ecbe3427086443ea122b53816d06 Mon Sep 17 00:00:00 2001 From: qist <87984115@qq.com> Date: Sun, 1 Feb 2026 17:21:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/run.yml | 4 +++- tools/fty.py | 17 +++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 2f8f6713..2769cbb3 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -38,7 +38,9 @@ jobs: \cp -pdr dianshi_merged_with_app_sites.json ../dianshi.json \cp -pdr jsm_merged_with_app_sites.json ../jsm.json \cp -pdr fan.txt ../jar/fan.txt - rm -rf dianshi_merged_with_app_sites.json jsm_merged_with_app_sites.json dianshi_merged.json jsm_merged.json tvbox_cleaned.json fan.txt + git clone --depth=1 --recursive https://github.com/fantaiying7/EXT.git + \cp -pdr EXT/* ../FTY/ + rm -rf dianshi_merged_with_app_sites.json jsm_merged_with_app_sites.json dianshi_merged.json jsm_merged.json tvbox_cleaned.json fan.txt EXT cd ../ shell: bash - name: Git push assets to "release" branch diff --git a/tools/fty.py b/tools/fty.py index 934df5ca..a6176c60 100644 --- a/tools/fty.py +++ b/tools/fty.py @@ -45,17 +45,26 @@ def extract_and_save_spider(json_text): # 删除不需要的 sites 项 + 替换链接 def clean_data(raw_text): - raw_text = raw_text.replace( - "https://gh-proxy.net/https://raw.githubusercontent.com/fantaiying7/EXT/refs/heads/main", - "./FTY" + # 统一把各种 GitHub 代理壳替换掉 + raw_text = re.sub( + r'https?://[^/]+/https://raw\.githubusercontent\.com/fantaiying7/EXT/refs/heads/main', + './FTY', + raw_text ) + data = demjson.decode(raw_text) keywords = [ "豆", "饭太硬", "广告", "PanSso", "YpanSo", "xzso", "米搜", "夸搜", "Aliso", "YiSo" ] + original_count = len(data.get("sites", [])) - data["sites"] = [s for s in data["sites"] if not any(kw in s.get("key", "") or kw in s.get("name", "") for kw in keywords)] + + data["sites"] = [ + s for s in data["sites"] + if not any(kw in s.get("key", "") or kw in s.get("name", "") for kw in keywords) + ] + print(f"🧹 清理 {original_count - len(data['sites'])} 条 sites") return data