| 97 | return combined |
| 98 | |
| 99 | def load_corrections(corrections_path: str) -> dict: |
| 100 | corrections = {} |
| 101 | lines = read_txt(corrections_path) |
| 102 | for line in lines: |
| 103 | if not line or "," not in line: |
| 104 | continue |
| 105 | parts = line.split(',') |
| 106 | correct_name = parts[0].strip() |
| 107 | for wrong_name in parts[1:]: |
| 108 | wrong_name = wrong_name.strip() |
| 109 | if wrong_name: |
| 110 | corrections[wrong_name] = correct_name |
| 111 | print(f"[INFO] 加载频道纠错规则数: {len(corrections)}") |
| 112 | return corrections |
| 113 | |
| 114 | # ===================== 频道名称/URL处理 ===================== |
| 115 | def clean_channel_name(name: str) -> str: |