Aggregator

repository·main·Indexed 27 days ago

https://github.com/wzdnzd/aggregator

A tool for building free proxy pools by crawling sources from platforms like Telegram, GitHub, Google, Yandex, and Twitter. It validates proxy quality and converts them into formats such as Clash, V2Ray, and SingBox. It supports multiple protocols including VMess, Trojan, SS, SSR, Snell, Hysteria2, VLESS, Hysteria, TUIC, AnyTLS, HTTP, and SOCKS. The tool offers a full-featured mode via process.py for advanced configuration and a simplified mode via collect.py for quick airport subscription collection.

Tokens
12.1K
Snippets
24
Records
43
Agent score
92%

What's inside wzdnzd-aggregator

  1. Overview of Aggregator

    main
    Aggregator is a powerful tool for building free proxy pools. It crawls proxy resources from multiple platforms (Telegram, GitHub, Google, Yandex, Twitter, etc.), automatically validates their quality, aggregates them, and converts them into various client formats like Clash, V2Ray, and SingBox. It supports a wide range of protocols including VMess, Trojan, SS, SSR, Snell, Hysteria2, VLESS, Hysteria, TUIC, AnyTLS, HTTP, and SOCKS.
  2. Understand Apple service routing logic

    main

    The Apple ruleset is designed to balance direct connections with proxying based on service availability in China.

    • Direct Connection: Known Apple domains are included in China.list and set to a direct connection strategy. Unless you have a specific requirement, you do not need to add these manually.
    • Proxying: Services that are blocked or restricted (e.g., App Store Preview, Moveis Trailers, Foreign Exchange queries, Spotlight international flight queries, and Dictionary Wikipedia queries) are included in Global.list for proxying.
    • Granular Control: This directory provides specific sub-domain rules (e.g., TestFlight.list, FindMy.list) for users experiencing issues with Apple services in their specific region. Instead of proxying all Apple traffic, it is recommended to use these granular rules for specific tasks like App Store downloads or System Updates.
  3. Understand Telegram rule files for Surge

    main

    The aggregator provides several rule files for Telegram services in Surge. Choose the one that matches your specific routing needs:

    • Telegram.list: This is the main Telegram rule file. It is already included in Global.list. Use this if you want to route all Telegram traffic through specific nodes for general acceleration. Only add this separately if you have a specific reason to override Global.list.
    • TelegramNL.list, TelegramSG.list, and TelegramUS.list: These are specialized rule files targeting specific Telegram data centers (Netherlands, Singapore, and United States). Use these if you need to optimize large file transfers by routing traffic to nodes in those specific geographic regions.
  4. Use Game Rulesets in Surge

    main

    The rulesets in this directory are designed to be used by referencing them in your Surge configuration to route game traffic through proxies.

    For optimal performance, it is recommended to first test and optimize your connection using UsbEAm Hosts Editor or UsbEAm Consoles DNS.

    If you find that specific download servers (e.g., origin-a.akamaihd.net) perform well via direct connection after applying suitable hosts, you can add those hosts to your Surge [Host] section and create corresponding rules to use a direct connection instead of a proxy.

  5. Configure Crawl-Only mode via environment variables

    main

    To run only the crawling phase without the full processing/pushing workflow, set the WORKFLOW_MODE environment variable to 1 before running process.py.

    # Set environment variable
    export WORKFLOW_MODE=1
    
    # Run crawling only
    python subscribe/process.py -s config.json
  6. Use the full-featured process.py mode

    main

    The process.py method is recommended for advanced users who need fine-grained control over crawling rules, multi-group output management, custom storage backends, and automated scheduled runs.

    To use it:

    1. Prepare a configuration file by copying the default template.
    2. Set the PUSH_TOKEN environment variable with your GitHub token.
    3. Run the processing script pointing to your config file.

    Common flags:

    • --check: Only check proxy activity without full processing.
    • -n <number>: Set the number of threads for high-performance mode.
  7. Install Aggregator

    main

    System Requirements

    • Python: 3.10 or higher
    • OS: Windows, Linux, or macOS
    • Storage: At least 100MB available space

    Installation Steps

    1. Clone the repository:
    git clone https://github.com/wzdnzd/aggregator.git
    cd aggregator
    1. Install dependencies using pip or conda:
    # Using pip
    pip install -r requirements.txt
    
    # Or using conda
    conda install --file requirements.txt
    1. Verify the installation:
    # Check Python version
    python --version
    
    # Test imports
    python -c "import yaml, requests; print('依赖安装成功')"
    git clone https://github.com/wzdnzd/aggregator.git
    cd aggregator
    pip install -r requirements.txt
  8. Configure Apple ruleset priority

    main

    To ensure correct routing for Apple services, place the rule files in the following order within your configuration:

    1. Global.list: Handles proxying for Apple services that are unavailable in mainland China.
    2. Apple.list: A general collection of Apple services. If you want to proxy all Apple services, use this file. Crucial: Place Apple.list between Global.list and China.list to prevent Global.list rules from being overridden by direct connection rules.
    3. Granular Apple Lists (e.g., TestFlight.list): Use these for specific proxying needs. These must be placed before China.list to ensure they take precedence over the default direct connection strategy.
    # Recommended Rule Order
    
    Global.list
    Apple.list
    [Other Apple Sub-lists]
    China.list
  9. Use the simplified collect.py mode

    main
    The collect.py method is a simplified version designed for quickly collecting airport subscriptions. It automatically collects, registers accounts, retrieves subscriptions, validates proxies, and uploads the results to GitHub Gist. This is ideal for personal daily use or beginners who do not require complex configurations.
  10. Use streaming media rulesets for regional split tunneling

    main

    You can use the streaming media split tunneling files located in this directory to route traffic based on geographic regions.

    Note: Streaming services with broad geographic coverage or those that do not implement strict regional restrictions (such as YouTube, Netflix, or Amazon Prime Video) are not included in these specific regional rulesets.

  11. Run the basic Aggregator workflow

    main

    To start the standard processing workflow, prepare a configuration file from the default template, edit it with your settings, and run process.py.

    1. Prepare Configuration: Copy the default config to your local directory.
    2. Edit: Modify my-config.json with your specific settings.
    3. Run: Execute the processing script pointing to your config file.

    Results will be automatically uploaded to your configured storage backend.