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

Method classify

main.py:240–253  ·  view source on GitHub ↗
(self, channel_name: str, channel_url: str, line: str)

Source from the content-addressed store, hash-verified

238
239 # === 全局单频道限流 ===
240 def classify(self, channel_name: str, channel_url: str, line: str):
241 # 先判断:黑名单/空URL → 跳过;单频道达上限 → 跳过
242 if channel_url in self.blacklist or not channel_url or self.is_single_chn_limit(channel_name):
243 return
244 # 原有分类逻辑不变
245 for chn_type, chn_names in self.main_dict.items():
246 if channel_name in chn_names and not self.check_url_exist(chn_type, channel_url):
247 self.add_channel_line(chn_type, line, channel_url)
248 return
249 for chn_type, chn_names in self.local_dict.items():
250 if channel_name in chn_names and not self.check_url_exist(chn_type, channel_url):
251 self.add_channel_line(chn_type, line, channel_url)
252 return
253 self.add_other_line(line, channel_url)
254
255 def get_channel_data(self, chn_type: str) -> list:
256 return self.channel_data.get(chn_type, [])

Callers 1

process_single_lineFunction · 0.80

Calls 4

is_single_chn_limitMethod · 0.95
check_url_existMethod · 0.95
add_channel_lineMethod · 0.95
add_other_lineMethod · 0.95

Tested by

no test coverage detected