#!/usr/bin/env python3 """domain_updater.py Facade entry point for vmess-domain-rotator. Delegates implementation to the modular rotator package while maintaining 100% backward compatibility for command line arguments and external python callers. """ import sys import os # 确保可以直接导入同目录下的 rotator 包 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) if SCRIPT_DIR not in sys.path: sys.path.insert(0, SCRIPT_DIR) from rotator.config import ( build_output_settings, build_url, get_source_type, parse_timezone, print_output_settings, resolve_path, to_float_or_none, validate_config, ) from rotator.filter import ( DOMAIN_RE, IPV4_RE, apply_filter, collect_excluded_domains, flatten_values, get_by_json_path, get_values_by_path, normalize_domain, resolve_field, rule_matches, ) from rotator.main import main, run_updater from rotator.notify import run_notify from rotator.scoring import ( base_top_candidate, build_api_candidate, build_cfst_candidate, build_lexicographic_descriptors, build_top_candidates, choose_domain, choose_top_candidate_domains, cmp_scalar, get_sort_field_value, maybe_resolve_field, parse_created_time, parse_scored_records, rank_scored_records, set_if_nonempty_text, text_or_blank, ) from rotator.sources import ( extract_records, fetch_api_json, load_cfst_rows, parse_domains, ) from rotator.storage import ( _atomic_write, read_json_file, utc_now_iso, write_json_file, write_text_file, ) __all__ = [ "DOMAIN_RE", "IPV4_RE", "_atomic_write", "apply_filter", "base_top_candidate", "build_api_candidate", "build_cfst_candidate", "build_lexicographic_descriptors", "build_output_settings", "build_top_candidates", "build_url", "choose_domain", "choose_top_candidate_domains", "cmp_scalar", "collect_excluded_domains", "extract_records", "fetch_api_json", "flatten_values", "get_by_json_path", "get_sort_field_value", "get_source_type", "get_values_by_path", "load_cfst_rows", "main", "maybe_resolve_field", "normalize_domain", "parse_created_time", "parse_domains", "parse_scored_records", "parse_timezone", "print_output_settings", "rank_scored_records", "read_json_file", "resolve_field", "resolve_path", "rule_matches", "run_notify", "run_updater", "set_if_nonempty_text", "text_or_blank", "to_float_or_none", "utc_now_iso", "validate_config", "write_json_file", "write_text_file", ] if __name__ == "__main__": main()