MCPcopy Create free account
hub / github.com/CCSH/IPTV / load_blacklist

Function load_blacklist

main.py:83–97  ·  view source on GitHub ↗
(blacklist_auto_path: str, blacklist_manual_path: str)

Source from the content-addressed store, hash-verified

81
82# ===================== 黑名单/纠错字典处理 =====================
83def load_blacklist(blacklist_auto_path: str, blacklist_manual_path: str) -> set:
84 def _extract_black_urls(file_path):
85 lines = read_txt(file_path)
86 urls = []
87 for line in lines:
88 if "," in line:
89 url = line.split(',')[1].strip()
90 if url:
91 urls.append(url)
92 return urls
93 auto_urls = _extract_black_urls(blacklist_auto_path)
94 manual_urls = _extract_black_urls(blacklist_manual_path)
95 combined = set(auto_urls + manual_urls)
96 print(f"[INFO] 合并黑名单URL数: {len(combined)}")
97 return combined
98
99def load_corrections(corrections_path: str) -> dict:
100 corrections = {}

Callers 1

main.pyFile · 0.85

Calls 1

_extract_black_urlsFunction · 0.85

Tested by

no test coverage detected