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

Method __init__

main.py:196–209  ·  view source on GitHub ↗
(self, main_dict: dict, local_dict: dict, blacklist: set)

Source from the content-addressed store, hash-verified

194# ===================== 频道分类核心 =====================
195class ChannelClassifier:
196 def __init__(self, main_dict: dict, local_dict: dict, blacklist: set):
197 self.main_dict = main_dict
198 self.local_dict = local_dict
199 self.blacklist = blacklist
200 self.channel_data = {}
201 self.other_lines = []
202 self.other_urls = set()
203 self.all_urls = {}
204 # === 全局单频道限流 新增:单频道计数字典 ===
205 self.single_chn_count = {} # key: 频道名(如CCTV1), value: 已添加源数量
206 # 初始化分类数据
207 for chn_type in list(main_dict.keys()) + list(local_dict.keys()):
208 self.channel_data[chn_type] = []
209 self.all_urls[chn_type] = set()
210
211 def check_url_exist(self, chn_type: str, url: str) -> bool:
212 if url in self.all_urls.get(chn_type, set()) or "127.0.0.1" in url:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected