From d054c3a55cbde5ee90f3e94c4cc26cbd25cdc859 Mon Sep 17 00:00:00 2001 From: Noufal Ibrahim Date: Fri, 2 Jan 2026 10:45:36 +0530 Subject: [PATCH 1/2] Removes unnecessary decoration in commits --- update_domains.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/update_domains.py b/update_domains.py index 1ce07d8..91365b7 100755 --- a/update_domains.py +++ b/update_domains.py @@ -22,9 +22,7 @@ CONFIG_FILE = "conf/conf.yaml" -# ============================================================================== -# Utility Functions -# ============================================================================== +## Utility Functions def fetch_url(url: str) -> bytes: """Fetch content from a URL.""" @@ -96,10 +94,7 @@ def find_domains_section_end(lines: list, start_idx: int) -> int: return len(lines) - -# ============================================================================== -# Source-Specific Functions: Bon Appetit Porn Domains -# ============================================================================== +## Source-Specific Functions: Bon Appetit Porn Domains def fetch_bon_appetit() -> Tuple[List[str], str, Dict]: """ @@ -166,9 +161,7 @@ def parse_bon_appetit(domain: str) -> str: return f' - {{"name": "{domain}", "always_block": true, "absolute": true}}' -# ============================================================================== -# Source-Specific Functions: StevenBlack Hosts -# ============================================================================== +## Source-Specific Functions: StevenBlack Hosts def fetch_stevenblack() -> Tuple[List[str], str, Dict]: """ From ab692ea0dba0566a1417678b42ddba03153a1053 Mon Sep 17 00:00:00 2001 From: Noufal Ibrahim Date: Fri, 2 Jan 2026 10:49:30 +0530 Subject: [PATCH 2/2] Converts all headers into simpler style --- update_domains.py | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/update_domains.py b/update_domains.py index 91365b7..a054114 100755 --- a/update_domains.py +++ b/update_domains.py @@ -237,9 +237,7 @@ def parse_stevenblack(domain: str) -> str: return f' - {{\"name\": \"{domain}\", \"always_block\": true, \"absolute\": true}}' -# ============================================================================== -# Source-Specific Functions: HaGeZi DoH/VPN/TOR/Proxy Bypass -# ============================================================================== +## Source-Specific Functions: HaGeZi DoH/VPN/TOR/Proxy Bypass def fetch_hagezi() -> Tuple[List[str], str, Dict]: """ @@ -317,9 +315,7 @@ def parse_hagezi(domain: str) -> str: return f' - {{\"name\": \"{domain}\", \"always_block\": true, \"absolute\": true}}' -# ============================================================================== -# Source-Specific Functions: UnblockStop Proxy Bypass -# ============================================================================== +## Source-Specific Functions: UnblockStop Proxy Bypass def fetch_unblockstop() -> Tuple[List[str], str, Dict]: """ @@ -383,10 +379,7 @@ def parse_unblockstop(domain: str) -> str: return f' - {{\"name\": \"{domain}\", \"always_block\": true, \"absolute\": true}}' -# ============================================================================== -# Source Registry -# ============================================================================== - +## Source Registry SOURCES = [ { 'id': 1, @@ -424,9 +417,7 @@ def parse_unblockstop(domain: str) -> str: ] -# ============================================================================== -# Generic Source Update Logic -# ============================================================================== +## Generic Source Update Logic def get_source_by_id(source_id: int) -> Optional[Dict]: """Get source definition by ID.""" @@ -583,10 +574,7 @@ def update_source(source_id: int): print(f" Error writing config file: {e}", file=sys.stderr) sys.exit(1) - -# ============================================================================== -# Strip Managed Sources -# ============================================================================== +## Strip Managed Sources def strip_managed_sources(): """Remove all managed domain lists from the config file.""" @@ -652,11 +640,7 @@ def strip_managed_sources(): print(f" Error writing config file: {e}", file=sys.stderr) sys.exit(1) - -# ============================================================================== -# Source Listing -# ============================================================================== - +## Source Listing def list_sources(): """Display all available sources with their current status.""" # Read config file once @@ -706,10 +690,7 @@ def list_sources(): print(" ./update_domains.py - Update a specific source") print(" ./update_domains.py strip - Remove all managed sources\n") - -# ============================================================================== -# Main Entry Point -# ============================================================================== +## Main Entry Point def main(): """Main execution function with CLI argument parsing."""