mirror of
https://github.com/qist/tvbox.git
synced 2026-04-13 10:52:49 +00:00
修改
This commit is contained in:
4
.github/workflows/run.yml
vendored
4
.github/workflows/run.yml
vendored
@@ -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
|
||||
|
||||
17
tools/fty.py
17
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user