Aggregator
repository·main·Indexed 27 days ago
https://github.com/wzdnzd/aggregatorA 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.
What's inside wzdnzd-aggregator
- 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.
Understand Apple service routing logic
mainThe 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.listand 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.listfor 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.
- Direct Connection: Known Apple domains are included in
Generate GitHub Personal Access Token
mainTo use features like GitHub Gist storage or GitHub crawling, you need a GitHub token:
- Visit GitHub Settings > Personal Access Tokens.
- Click "Generate new token (classic)".
- Set the following permissions:
gist: To create and edit Gists.repo: To access repositories (if required).
- Copy the generated token.
Understand Telegram rule files for Surge
mainThe 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 inGlobal.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 overrideGlobal.list.TelegramNL.list,TelegramSG.list, andTelegramUS.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.
Use Game Rulesets in Surge
mainThe 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.Configure Crawl-Only mode via environment variables
mainTo run only the crawling phase without the full processing/pushing workflow, set the
WORKFLOW_MODEenvironment variable to1before runningprocess.py.# Set environment variable export WORKFLOW_MODE=1 # Run crawling only python subscribe/process.py -s config.jsonUse the full-featured process.py mode
mainThe
process.pymethod 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:
- Prepare a configuration file by copying the default template.
- Set the
PUSH_TOKENenvironment variable with your GitHub token. - 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.
Install Aggregator
mainSystem Requirements
- Python: 3.10 or higher
- OS: Windows, Linux, or macOS
- Storage: At least 100MB available space
Installation Steps
- Clone the repository:
git clone https://github.com/wzdnzd/aggregator.git cd aggregator- Install dependencies using
piporconda:
# Using pip pip install -r requirements.txt # Or using conda conda install --file requirements.txt- 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.txtConfigure Apple ruleset priority
mainTo ensure correct routing for Apple services, place the rule files in the following order within your configuration:
Global.list: Handles proxying for Apple services that are unavailable in mainland China.Apple.list: A general collection of Apple services. If you want to proxy all Apple services, use this file. Crucial: PlaceApple.listbetweenGlobal.listandChina.listto preventGlobal.listrules from being overridden by direct connection rules.- Granular Apple Lists (e.g.,
TestFlight.list): Use these for specific proxying needs. These must be placed beforeChina.listto ensure they take precedence over the default direct connection strategy.
# Recommended Rule Order Global.list Apple.list [Other Apple Sub-lists] China.listUse the simplified collect.py mode
mainThecollect.pymethod 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.Use streaming media rulesets for regional split tunneling
mainYou 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.
Run the basic Aggregator workflow
mainTo start the standard processing workflow, prepare a configuration file from the default template, edit it with your settings, and run
process.py.- Prepare Configuration: Copy the default config to your local directory.
- Edit: Modify
my-config.jsonwith your specific settings. - Run: Execute the processing script pointing to your config file.
Results will be automatically uploaded to your configured storage backend.